Makes tests inherit from ActionView::TestCase.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8277 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
cf5dba2beb
commit
eed1a5dfbd
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
require File.expand_path('../../../test_helper', __FILE__)
|
require File.expand_path('../../../test_helper', __FILE__)
|
||||||
|
|
||||||
class IssuesHelperTest < HelperTestCase
|
class IssuesHelperTest < ActionView::TestCase
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
include IssuesHelper
|
include IssuesHelper
|
||||||
|
|
||||||
|
@ -31,24 +31,10 @@ class IssuesHelperTest < HelperTestCase
|
||||||
:enabled_modules,
|
:enabled_modules,
|
||||||
:workflows
|
:workflows
|
||||||
|
|
||||||
# Used by assert_select
|
|
||||||
def html_document
|
|
||||||
HTML::Document.new(@response.body)
|
|
||||||
end
|
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
set_language_if_valid('en')
|
set_language_if_valid('en')
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
end
|
|
||||||
|
|
||||||
def controller
|
|
||||||
@controller ||= IssuesController.new
|
|
||||||
end
|
|
||||||
|
|
||||||
def request
|
|
||||||
@request ||= ActionController::TestRequest.new
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_issue_heading
|
def test_issue_heading
|
||||||
|
@ -95,29 +81,27 @@ class IssuesHelperTest < HelperTestCase
|
||||||
context "with html" do
|
context "with html" do
|
||||||
should 'show a changing attribute with HTML highlights' do
|
should 'show a changing attribute with HTML highlights' do
|
||||||
@detail = JournalDetail.generate!(:property => 'attr', :old_value => '40', :value => '100', :prop_key => 'done_ratio')
|
@detail = JournalDetail.generate!(:property => 'attr', :old_value => '40', :value => '100', :prop_key => 'done_ratio')
|
||||||
@response.body = show_detail(@detail, false)
|
html = show_detail(@detail, false)
|
||||||
|
|
||||||
assert_select 'strong', :text => '% Done'
|
assert_include '<strong>% Done</strong>', html
|
||||||
assert_select 'i', :text => '40'
|
assert_include '<i>40</i>', html
|
||||||
assert_select 'i', :text => '100'
|
assert_include '<i>100</i>', html
|
||||||
end
|
end
|
||||||
|
|
||||||
should 'show a new attribute with HTML highlights' do
|
should 'show a new attribute with HTML highlights' do
|
||||||
@detail = JournalDetail.generate!(:property => 'attr', :old_value => nil, :value => '100', :prop_key => 'done_ratio')
|
@detail = JournalDetail.generate!(:property => 'attr', :old_value => nil, :value => '100', :prop_key => 'done_ratio')
|
||||||
@response.body = show_detail(@detail, false)
|
html = show_detail(@detail, false)
|
||||||
|
|
||||||
assert_select 'strong', :text => '% Done'
|
assert_include '<strong>% Done</strong>', html
|
||||||
assert_select 'i', :text => '100'
|
assert_include '<i>100</i>', html
|
||||||
end
|
end
|
||||||
|
|
||||||
should 'show a deleted attribute with HTML highlights' do
|
should 'show a deleted attribute with HTML highlights' do
|
||||||
@detail = JournalDetail.generate!(:property => 'attr', :old_value => '50', :value => nil, :prop_key => 'done_ratio')
|
@detail = JournalDetail.generate!(:property => 'attr', :old_value => '50', :value => nil, :prop_key => 'done_ratio')
|
||||||
@response.body = show_detail(@detail, false)
|
html = show_detail(@detail, false)
|
||||||
|
|
||||||
assert_select 'strong', :text => '% Done'
|
assert_include '<strong>% Done</strong>', html
|
||||||
assert_select 'strike' do
|
assert_include '<strike><i>50</i></strike>', html
|
||||||
assert_select 'i', :text => '50'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -183,7 +167,5 @@ class IssuesHelperTest < HelperTestCase
|
||||||
|
|
||||||
should "test custom fields"
|
should "test custom fields"
|
||||||
should "test attachments"
|
should "test attachments"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue