mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Speed-up spec
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
require 'spec_helper'
|
||||
require "spec_helper"
|
||||
|
||||
feature "Confirm invitation" do
|
||||
feature "Confirm invitation as manager" do
|
||||
include UIComponentHelper # for be_logged_in_as
|
||||
|
||||
describe "confirm email" do
|
||||
describe "confirm email and set password" do
|
||||
let(:email) { "test@example.org" }
|
||||
let(:user) { Spree::User.create(email: email, unconfirmed_email: email, password: "secret") }
|
||||
|
||||
@@ -13,21 +13,16 @@ feature "Confirm invitation" do
|
||||
user.save!
|
||||
end
|
||||
|
||||
it "confirms the email address" do
|
||||
visit spree.spree_user_confirmation_url(confirmation_token: user.confirmation_token)
|
||||
expect(user.reload.confirmed?).to be true
|
||||
end
|
||||
|
||||
it "redirects to set a password" do
|
||||
visit spree.spree_user_confirmation_url(confirmation_token: user.confirmation_token)
|
||||
expect(page).to have_text "Change my password"
|
||||
end
|
||||
|
||||
it "allows you to set a password" do
|
||||
visit spree.spree_user_confirmation_url(confirmation_token: user.confirmation_token)
|
||||
|
||||
expect(user.reload.confirmed?).to be true
|
||||
expect(page).to have_text "Change my password"
|
||||
|
||||
fill_in "Password", with: "my secret"
|
||||
fill_in "Password Confirmation", with: "my secret"
|
||||
click_button
|
||||
|
||||
expect(page).to have_no_text "Reset password token has expired"
|
||||
expect(page).to be_logged_in_as user
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user