ActionMailer::Base.deliveries.clear
- basic_authorization(third_user.email, "test")
+ basic_authorization third_user.email, "test"
assert_difference "NoteComment.count", 1 do
assert_difference "ActionMailer::Base.deliveries.size", 2 do
post :close, :params => { :id => open_note_with_comment.id, :text => "This is a close comment", :format => "json" }
assert_response :unauthorized
- basic_authorization(user.email, "test")
+ basic_authorization user.email, "test"
post :close, :params => { :id => open_note_with_comment.id, :text => "This is a close comment", :format => "json" }
assert_response :success
post :close
assert_response :unauthorized
- basic_authorization(create(:user).email, "test")
+ basic_authorization create(:user).email, "test"
post :close
assert_response :bad_request
post :reopen, :params => { :id => closed_note_with_comment.id, :text => "This is a reopen comment", :format => "json" }
assert_response :unauthorized
- basic_authorization(user.email, "test")
+ basic_authorization user.email, "test"
post :reopen, :params => { :id => closed_note_with_comment.id, :text => "This is a reopen comment", :format => "json" }
assert_response :success
post :reopen, :params => { :id => hidden_note_with_comment.id }
assert_response :unauthorized
- basic_authorization(create(:user).email, "test")
+ basic_authorization create(:user).email, "test"
post :reopen, :params => { :id => 12345 }
assert_response :not_found
delete :destroy, :params => { :id => open_note_with_comment.id, :text => "This is a hide comment", :format => "json" }
assert_response :unauthorized
- basic_authorization(user.email, "test")
+ basic_authorization user.email, "test"
delete :destroy, :params => { :id => open_note_with_comment.id, :text => "This is a hide comment", :format => "json" }
assert_response :forbidden
- basic_authorization(moderator_user.email, "test")
+ basic_authorization moderator_user.email, "test"
delete :destroy, :params => { :id => open_note_with_comment.id, :text => "This is a hide comment", :format => "json" }
assert_response :success
delete :destroy, :params => { :id => 12345, :format => "json" }
assert_response :unauthorized
- basic_authorization(user.email, "test")
+ basic_authorization user.email, "test"
delete :destroy, :params => { :id => 12345, :format => "json" }
assert_response :forbidden
- basic_authorization(moderator_user.email, "test")
+ basic_authorization moderator_user.email, "test"
delete :destroy, :params => { :id => 12345, :format => "json" }
assert_response :not_found