aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views
diff options
context:
space:
mode:
authorlouise <louise>2009-04-14 13:36:32 +0000
committerlouise <louise>2009-04-14 13:36:32 +0000
commit0b0d0a70419e9891627f82584fa873f2c189750c (patch)
treeb33b0b1d884418f1777266690ea8ef5a57e2354a /spec/views
parent088349d1561b2072f9837d49cb16de89f740cce9 (diff)
Adding form for anyone logged in to update the status of a request that is old and unclassified
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/request/_describe_state.rhtml_spec.rb42
1 files changed, 34 insertions, 8 deletions
diff --git a/spec/views/request/_describe_state.rhtml_spec.rb b/spec/views/request/_describe_state.rhtml_spec.rb
index ebb1d5a91..8460013d3 100644
--- a/spec/views/request/_describe_state.rhtml_spec.rb
+++ b/spec/views/request/_describe_state.rhtml_spec.rb
@@ -22,20 +22,46 @@ describe 'when showing the form for describing the state of a request' do
assigns[:info_request] = @mock_request
end
- describe 'if the user is a regular user' do
+ describe 'if the user is a regular user (not the request owner)' do
before do
assigns[:is_owning_user] = false
end
- it 'should not show the form' do
- do_render
- response.should_not have_tag('form')
- end
+ describe 'if the request is not old and unclassified' do
+
+ it 'should not show the form' do
+ do_render
+ response.should_not have_tag('h2', :text => 'What best describes the status of this request now?')
+ end
- it 'should give a link to login' do
- do_render
- response.should have_tag('a', :text => 'sign in')
+ it 'should give a link to login' do
+ do_render
+ response.should have_tag('a', :text => 'sign in')
+ end
+
+ end
+
+ describe 'if the request is old and unclassified' do
+
+ before do
+ assigns[:old_unclassified] = true
+ end
+
+ it 'should not show the form' do
+ do_render
+ response.should_not have_tag('h2', :text => 'What best describes the status of this request now?')
+ end
+
+ it 'should show the form for someone else to classify the request' do
+ do_render
+ response.should have_tag('h2', :text => 'Can you help us by describing the status of this request now?')
+ end
+
+ it 'should not give a link to login' do
+ do_render
+ response.should_not have_tag('a', :text => 'sign in')
+ end
end
end