before_filter :authorize_web, :only => [:mine]
before_filter :setup_user_auth, :only => [:create, :comment]
before_filter :authorize, :only => [:close, :destroy]
+ before_filter :require_moderator, :only => [:destroy]
before_filter :check_api_writable, :only => [:create, :comment, :close, :destroy]
before_filter :require_allow_write_notes, :only => [:create, :comment, :close, :destroy]
before_filter :set_locale, :only => [:mine]
basic_authorization(users(:public_user).email, "test")
+ delete :destroy, {:id => notes(:open_note_with_comment).id}
+ assert_response :forbidden
+
+ basic_authorization(users(:moderator_user).email, "test")
+
delete :destroy, {:id => notes(:open_note_with_comment).id}
assert_response :success
basic_authorization(users(:public_user).email, "test")
+ delete :destroy, {:id => 12345}
+ assert_response :forbidden
+
+ basic_authorization(users(:moderator_user).email, "test")
+
delete :destroy, {:id => 12345}
assert_response :not_found