Skip to content

Instantly share code, notes, and snippets.

@andreaseriksson
Created May 18, 2013 13:42
Show Gist options
  • Save andreaseriksson/5604434 to your computer and use it in GitHub Desktop.
Save andreaseriksson/5604434 to your computer and use it in GitHub Desktop.
RSPEC Controller spec #CUSTOM ACTION
describe "PUT flag_as_inappropriate" do
before :each do
@message = create(:message)
end
it "marks the message as inappropriate" do
put :flag_as_inappropriate, id: @message
@message.reload.is_inappropriate?.should be_true
expect(@message.reload.is_inappropriate?).to be_true
end
it "redirects to messages#index" do
put :flag_as_inappropriate, id: @message
expect(response).to redirect_to messages_url
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment