aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-06-07 17:07:00 +0100
committerLouise Crow <louise.crow@gmail.com>2013-06-07 17:07:00 +0100
commiteff801d14ab7d5be11518190a10ebf0b0deb3db2 (patch)
tree684b1d83fdb7e0f4ae05eadf84df663429177816 /spec/controllers/request_controller_spec.rb
parent05017eee973ee1fbbf1de4ebeea478de0cd3c375 (diff)
Allow the donation url to be configured. Closes #909.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 734eb62fb..06862f5e2 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -1708,6 +1708,20 @@ describe RequestController, "when classifying an information request" do
expect_redirect('successful', request_url)
end
+ it 'should show a message including the donation url if there is one' do
+ AlaveteliConfiguration.stub!(:donation_url).and_return('http://donations.example.com')
+ post_status('successful')
+ flash[:notice].should match('make a donation')
+ flash[:notice].should match('http://donations.example.com')
+ end
+
+ it 'should show a message without reference to donations if there is no
+ donation url' do
+ AlaveteliConfiguration.stub!(:donation_url).and_return('')
+ post_status('successful')
+ flash[:notice].should_not match('make a donation')
+ end
+
end
context 'when status is updated to "waiting clarification"' do
@@ -1740,6 +1754,20 @@ describe RequestController, "when classifying an information request" do
expect_redirect('partially_successful', "help/unhappy/#{@dog_request.url_title}")
end
+ it 'should show a message including the donation url if there is one' do
+ AlaveteliConfiguration.stub!(:donation_url).and_return('http://donations.example.com')
+ post_status('successful')
+ flash[:notice].should match('make a donation')
+ flash[:notice].should match('http://donations.example.com')
+ end
+
+ it 'should show a message without reference to donations if there is no
+ donation url' do
+ AlaveteliConfiguration.stub!(:donation_url).and_return('')
+ post_status('successful')
+ flash[:notice].should_not match('make a donation')
+ end
+
end
context 'when status is updated to "gone postal"' do