Skip to content

Instantly share code, notes, and snippets.

@msarit
Created April 6, 2018 15:19
Show Gist options
  • Save msarit/c300b06853a39425c21015cb48249e16 to your computer and use it in GitHub Desktop.
Save msarit/c300b06853a39425c21015cb48249e16 to your computer and use it in GitHub Desktop.
describe "grams#edit action" do
it "shouldn't let a user who did not create the gram edit a gram" do
gram = FactoryBot.create(:gram)
diff_user = FactoryBot.create(:user)
sign_in diff_user
get :edit, params: { id: gram.id }
expect(response).to have_http_status(:forbidden)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment