Skip to content

Instantly share code, notes, and snippets.

@msarit
Last active April 6, 2018 15:04
Show Gist options
  • Save msarit/a1747135d32f24853e9518b194fdc1ca to your computer and use it in GitHub Desktop.
Save msarit/a1747135d32f24853e9518b194fdc1ca to your computer and use it in GitHub Desktop.
grams#edit action
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)
user = FactoryBot.create(:user)
sign_in 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