diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-09-19 15:32:27 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-09-19 15:32:27 +0100 |
commit | 550f143a9c9be1ebdfe257fe853a2adf1e13973c (patch) | |
tree | 64890a49f5f567392bd1b7be7cc0c582329f66a9 /spec/controllers/comment_controller_spec.rb | |
parent | dd533b28f1101a4150365bbd7f16f276396364e8 (diff) |
Add an option to disable comments on a request
Closes #30.
Diffstat (limited to 'spec/controllers/comment_controller_spec.rb')
-rw-r--r-- | spec/controllers/comment_controller_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/controllers/comment_controller_spec.rb b/spec/controllers/comment_controller_spec.rb index b71bc0aea..4a7acee23 100644 --- a/spec/controllers/comment_controller_spec.rb +++ b/spec/controllers/comment_controller_spec.rb @@ -53,6 +53,17 @@ describe CommentController, "when commenting on a request" do response.should render_template('new') end + + it "should not allow comments if comments are not allowed" do + session[:user_id] = users(:silly_name_user).id + + expect { + post :new, :url_title => info_requests(:spam_1_request).url_title, + :comment => { :body => "I demand to be heard!" }, + :type => 'request', :submitted_comment => 1, :preview => 0 + }.to raise_error("Comments are not allowed on this request") + + end describe 'when commenting on an external request' do |