-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[webui] Moving computed data to a constant Hash
- Loading branch information
Showing
2 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require File.join File.dirname(__FILE__), '..', 'test_helper' | ||
|
||
include RequestHelper | ||
include ActionView::Helpers::TagHelper | ||
|
||
class RequestHelperTest < ActiveSupport::TestCase | ||
|
||
def test_request_state_icon | ||
request = RequestHelperTmp.new('new') | ||
assert_equal 'icons/flag_green.png', request_state_icon(request) | ||
|
||
request = RequestHelperTmp.new('unknown') | ||
assert_equal '', request_state_icon(request) | ||
end | ||
end | ||
|
||
class RequestHelperTmp | ||
@ret = nil | ||
def initialize(ret) | ||
@ret = ret | ||
end | ||
def state | ||
self | ||
end | ||
def value(key) | ||
@ret | ||
end | ||
end |