diff options
-rw-r--r-- | spec/views/request/_after_actions.rhtml_spec.rb | 6 | ||||
-rw-r--r-- | spec/views/request/_describe_state.rhtml_spec.rb | 12 | ||||
-rw-r--r-- | spec/views/request/list.rhtml_spec.rb | 16 | ||||
-rw-r--r-- | spec/views/request/show.rhtml_spec.rb | 10 | ||||
-rw-r--r-- | spec/views/request_game/play.rhtml_spec.rb | 8 |
5 files changed, 26 insertions, 26 deletions
diff --git a/spec/views/request/_after_actions.rhtml_spec.rb b/spec/views/request/_after_actions.rhtml_spec.rb index 5b4734c52..cbf91f2d4 100644 --- a/spec/views/request/_after_actions.rhtml_spec.rb +++ b/spec/views/request/_after_actions.rhtml_spec.rb @@ -14,7 +14,7 @@ describe 'when displaying actions that can be taken with regard to a request' do :public_body => @mock_body, :comments_allowed? => true, :url_title => 'test_request') - assigns[:info_request] = @mock_request + assign :info_request, @mock_request end def do_render @@ -50,7 +50,7 @@ describe 'when displaying actions that can be taken with regard to a request' do describe 'if the request is old and unclassified' do before do - assigns[:old_unclassified] = true + assign :old_unclassified, true end it 'should not display a link for the request owner to update the status of the request' do @@ -66,7 +66,7 @@ describe 'when displaying actions that can be taken with regard to a request' do describe 'if the request is not old and unclassified' do before do - assigns[:old_unclassified] = false + assign :old_unclassified, false end it 'should display a link for the request owner to update the status of the request' do diff --git a/spec/views/request/_describe_state.rhtml_spec.rb b/spec/views/request/_describe_state.rhtml_spec.rb index 18778d5d2..25ef05de4 100644 --- a/spec/views/request/_describe_state.rhtml_spec.rb +++ b/spec/views/request/_describe_state.rhtml_spec.rb @@ -24,13 +24,13 @@ describe 'when showing the form for describing the state of a request' do :user_name => @mock_user.name, :is_external? => false ) - assigns[:info_request] = @mock_request + assign :info_request, @mock_request end describe 'if the user is a regular user (not the request owner)' do before do - assigns[:is_owning_user] = false + assign :is_owning_user, false end describe 'if the request is not old and unclassified' do @@ -50,7 +50,7 @@ describe 'when showing the form for describing the state of a request' do describe 'if the request is old and unclassified' do before do - assigns[:old_unclassified] = true + assign :old_unclassified, true end it 'should not show the form' do @@ -74,7 +74,7 @@ describe 'when showing the form for describing the state of a request' do describe 'if showing the form to the user owning the request' do before do - assigns[:is_owning_user] = true + assign :is_owning_user, true end describe 'when the request is not in internal review' do @@ -100,7 +100,7 @@ describe 'when showing the form for describing the state of a request' do describe 'when the user has asked to update the status of the request' do before do - assigns[:update_status] = true + assign :update_status, true end it 'should show a radio button to set the status to "internal_review"' do @@ -170,4 +170,4 @@ describe 'when showing the form for describing the state of a request' do end end -end
\ No newline at end of file +end diff --git a/spec/views/request/list.rhtml_spec.rb b/spec/views/request/list.rhtml_spec.rb index 137bc359d..e6e67dcbf 100644 --- a/spec/views/request/list.rhtml_spec.rb +++ b/spec/views/request/list.rhtml_spec.rb @@ -3,8 +3,8 @@ require File.expand_path(File.join('..', '..', '..', 'spec_helper'), __FILE__) describe "when listing recent requests" do before do - assigns[:page] = 1 - assigns[:per_page] = 10 + assign :page, 1 + assign :per_page, 10 # work round a bug in ActionController::TestRequest; allows request.query_string to work in the template request.env["REQUEST_URI"] = "" end @@ -30,18 +30,18 @@ describe "when listing recent requests" do end it "should be successful" do - assigns[:list_results] = [ make_mock_event, make_mock_event ] - assigns[:matches_estimated] = 2 - assigns[:show_no_more_than] = 100 + assign :list_results, [ make_mock_event, make_mock_event ] + assign :matches_estimated, 2 + assign :show_no_more_than, 100 render "request/list" response.should have_tag("div.request_listing") response.should_not have_tag("p", /No requests of this sort yet/m) end it "should cope with no results" do - assigns[:list_results] = [ ] - assigns[:matches_estimated] = 0 - assigns[:show_no_more_than] = 0 + assign :list_results, [ ] + assign :matches_estimated, 0 + assign :show_no_more_than, 0 render "request/list" response.should have_tag("p", /No requests of this sort yet/m) response.should_not have_tag("div.request_listing") diff --git a/spec/views/request/show.rhtml_spec.rb b/spec/views/request/show.rhtml_spec.rb index 4429e9e58..9db7991e2 100644 --- a/spec/views/request/show.rhtml_spec.rb +++ b/spec/views/request/show.rhtml_spec.rb @@ -23,9 +23,9 @@ describe 'when viewing an information request' do end def request_page - assigns[:info_request] = @mock_request - assigns[:info_request_events] = [] - assigns[:status] = @mock_request.calculate_status + assign :info_request, @mock_request + assign :info_request_events, [] + assign :status, @mock_request.calculate_status template.stub!(:render_partial) render 'request/show' end @@ -43,7 +43,7 @@ describe 'when viewing an information request' do describe 'when a status update has been requested' do before do - assigns[:update_status] = true + assign :update_status, true end it 'should show the first form for describing the state of the request' do @@ -74,7 +74,7 @@ describe 'when viewing an information request' do describe 'when the user is the request owner' do before do - assigns[:is_owning_user] = true + assign :is_owning_user, true end describe 'when the request status is "waiting clarification"' do diff --git a/spec/views/request_game/play.rhtml_spec.rb b/spec/views/request_game/play.rhtml_spec.rb index 24fb6d75d..0353f25b5 100644 --- a/spec/views/request_game/play.rhtml_spec.rb +++ b/spec/views/request_game/play.rhtml_spec.rb @@ -22,10 +22,10 @@ describe 'when viewing the request game' do :initial_request_text => 'hi there', :display_status => 'Awaiting categorisation', :created_at => Time.now) - assigns[:league_table_28_days] = [] - assigns[:league_table_all_time] = [] - assigns[:requests] = [@mock_request] - assigns[:play_urls] = true + assign :league_table_28_days, [] + assign :league_table_all_time, [] + assign :requests, [@mock_request] + assign :play_urls, true end it 'should show the correct url for a request' do |