Skip to content

Instantly share code, notes, and snippets.

@terenceponce
Last active July 13, 2020 02:22
Show Gist options
  • Save terenceponce/cd35094cec62a21be742 to your computer and use it in GitHub Desktop.
Save terenceponce/cd35094cec62a21be742 to your computer and use it in GitHub Desktop.
Creating Signed Cookies in Capybara
# spec/features/profile_management_spec.rb
require 'rails_helper'
feature 'Profile Management', type: :feature do
given!(:user) { create(:user) }
scenario 'User updates profile' do
cookie = SignedCookieGenerator.new(:auth, user.id)
page.driver.browser.set_cookie(cookie.to_s)
visit '/account/profile'
expect(page).to have_text('Profile Page')
end
end
@terenceponce
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment