From 58601ebdab0cfa90e823418ccd587a0a503a985f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 25 Nov 2013 20:07:55 +0200 Subject: [PATCH] Fix tests after user password length was changed --- features/steps/profile/profile.rb | 12 ++++++------ spec/factories.rb | 2 +- spec/models/user_spec.rb | 4 ++-- spec/support/login_helpers.rb | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 753e2c1..9d091e9 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -33,24 +33,24 @@ class Profile < Spinach::FeatureSteps step 'I try change my password w/o old one' do within '.update-password' do - fill_in "user_password", with: "222333" - fill_in "user_password_confirmation", with: "222333" + fill_in "user_password", with: "22233344" + fill_in "user_password_confirmation", with: "22233344" click_button "Save" end end step 'I change my password' do within '.update-password' do - fill_in "user_current_password", with: "123456" - fill_in "user_password", with: "222333" - fill_in "user_password_confirmation", with: "222333" + fill_in "user_current_password", with: "12345678" + fill_in "user_password", with: "22233344" + fill_in "user_password_confirmation", with: "22233344" click_button "Save" end end step 'I unsuccessfully change my password' do within '.update-password' do - fill_in "user_current_password", with: "123456" + fill_in "user_current_password", with: "12345678" fill_in "user_password", with: "password" fill_in "user_password_confirmation", with: "confirmation" click_button "Save" diff --git a/spec/factories.rb b/spec/factories.rb index 3b0e305..daf8417 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -15,7 +15,7 @@ FactoryGirl.define do email { Faker::Internet.email } name sequence(:username) { |n| "#{Faker::Internet.user_name}#{n}" } - password "123456" + password "12345678" password_confirmation { password } confirmed_at { Time.now } confirmation_token { nil } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 8b9e0b3..59f75ae 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -90,8 +90,8 @@ describe User do end it "should not generate password by default" do - user = create(:user, password: 'abcdefg') - user.password.should == 'abcdefg' + user = create(:user, password: 'abcdefghe') + user.password.should == 'abcdefghe' end it "should generate password when forcing random password" do diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb index 025534a..cc0ec2f 100644 --- a/spec/support/login_helpers.rb +++ b/spec/support/login_helpers.rb @@ -16,7 +16,7 @@ module LoginHelpers def login_with(user) visit new_user_session_path fill_in "user_login", with: user.email - fill_in "user_password", with: "123456" + fill_in "user_password", with: "12345678" click_button "Sign in" Thread.current[:current_user] = user end -- libgit2 0.21.2