From eff801d14ab7d5be11518190a10ebf0b0deb3db2 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Fri, 7 Jun 2013 17:07:00 +0100 Subject: Allow the donation url to be configured. Closes #909. --- spec/controllers/request_controller_spec.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'spec/controllers/request_controller_spec.rb') 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 -- cgit v1.2.3