fixes specs

This commit is contained in:
rgarcia
2016-12-23 19:05:25 +01:00
parent 37462b79cd
commit ddeca6f06d
7 changed files with 17 additions and 13 deletions

View File

@@ -51,7 +51,7 @@ class Signature < ActiveRecord::Base
created_from_signature: true, created_from_signature: true,
verified_at: Time.now, verified_at: Time.now,
erased_at: Time.now, erased_at: Time.now,
email: "#{document_number}@signatures.com", email: "#{document_number}@inexistent.dev",
password: "12345678", password: "12345678",
username: document_number, username: document_number,
terms_of_service: '1' terms_of_service: '1'

View File

@@ -19,4 +19,4 @@
<%= f.text_area :document_numbers, rows: "6", label: false %> <%= f.text_area :document_numbers, rows: "6", label: false %>
<%= f.submit(class: "button", value: t("admin.signature_sheets.new.submit")) %> <%= f.submit(class: "button", value: t("admin.signature_sheets.new.submit")) %>
<% end %> <% end %>

View File

@@ -29,6 +29,10 @@ feature 'Signature sheets' do
click_button "Create signature sheet" click_button "Create signature sheet"
expect(page).to have_content "Signature sheet created successfully" expect(page).to have_content "Signature sheet created successfully"
visit proposal_path(proposal)
expect(page).to have_content "1 support"
end end
scenario 'Errors on create' do scenario 'Errors on create' do

View File

@@ -47,7 +47,7 @@ feature 'DocumentVerifications' do
scenario 'Verifying a user which does exists in the census but not in the db redirects allows sending an email' do scenario 'Verifying a user which does exists in the census but not in the db redirects allows sending an email' do
visit management_document_verifications_path visit management_document_verifications_path
fill_in 'document_verification_document_number', with: '1234' fill_in 'document_verification_document_number', with: '12345678Z'
click_button 'Check' click_button 'Check'
expect(page).to have_content "Please introduce the email used on the account" expect(page).to have_content "Please introduce the email used on the account"
@@ -66,7 +66,7 @@ feature 'DocumentVerifications' do
expect_any_instance_of(Verification::Management::Document).to receive(:under_sixteen?).and_return(true) expect_any_instance_of(Verification::Management::Document).to receive(:under_sixteen?).and_return(true)
visit management_document_verifications_path visit management_document_verifications_path
fill_in 'document_verification_document_number', with: '1234' fill_in 'document_verification_document_number', with: '12345678Z'
click_button 'Check' click_button 'Check'
expect(page).to have_content "You must be over 16 to verify your account." expect(page).to have_content "You must be over 16 to verify your account."

View File

@@ -8,7 +8,7 @@ feature 'EmailVerifications' do
user = create(:user) user = create(:user)
visit management_document_verifications_path visit management_document_verifications_path
fill_in 'document_verification_document_number', with: '1234' fill_in 'document_verification_document_number', with: '12345678Z'
click_button 'Check' click_button 'Check'
expect(page).to have_content "Please introduce the email used on the account" expect(page).to have_content "Please introduce the email used on the account"
@@ -30,7 +30,7 @@ feature 'EmailVerifications' do
expect(page).to_not have_link "Verify my account" expect(page).to_not have_link "Verify my account"
expect(page).to have_content "Account verified" expect(page).to have_content "Account verified"
expect(user.reload.document_number).to eq('1234') expect(user.reload.document_number).to eq('12345678Z')
expect(user).to be_level_three_verified expect(user).to be_level_three_verified
end end

View File

@@ -57,7 +57,7 @@ feature 'Managed User' do
user = create(:user) user = create(:user)
visit management_document_verifications_path visit management_document_verifications_path
fill_in 'document_verification_document_number', with: '1234' fill_in 'document_verification_document_number', with: '12345678Z'
click_button 'Check' click_button 'Check'
within(".account-info") do within(".account-info") do
@@ -66,7 +66,7 @@ feature 'Managed User' do
expect(page).not_to have_content "Email" expect(page).not_to have_content "Email"
expect(page).to have_content "Document type" expect(page).to have_content "Document type"
expect(page).to have_content "Document number" expect(page).to have_content "Document number"
expect(page).to have_content "1234" expect(page).to have_content "12345678Z"
end end
expect(page).to have_content "Please introduce the email used on the account" expect(page).to have_content "Please introduce the email used on the account"
@@ -88,7 +88,7 @@ feature 'Managed User' do
login_as_manager login_as_manager
visit management_document_verifications_path visit management_document_verifications_path
fill_in 'document_verification_document_number', with: '1234' fill_in 'document_verification_document_number', with: '12345678Z'
click_button 'Check' click_button 'Check'
expect(page).to have_content "Please introduce the email used on the account" expect(page).to have_content "Please introduce the email used on the account"

View File

@@ -9,7 +9,7 @@ feature 'Users' do
scenario 'Create a level 3 user from scratch' do scenario 'Create a level 3 user from scratch' do
visit management_document_verifications_path visit management_document_verifications_path
fill_in 'document_verification_document_number', with: '1234' fill_in 'document_verification_document_number', with: '12345678Z'
click_button 'Check' click_button 'Check'
expect(page).to have_content "Please introduce the email used on the account" expect(page).to have_content "Please introduce the email used on the account"
@@ -45,10 +45,10 @@ feature 'Users' do
end end
scenario 'Delete a level 2 user account from document verification page', :js do scenario 'Delete a level 2 user account from document verification page', :js do
level_2_user = create(:user, :level_two, document_number: 13579) level_2_user = create(:user, :level_two, document_number: "12345678Z")
visit management_document_verifications_path visit management_document_verifications_path
fill_in 'document_verification_document_number', with: '13579' fill_in 'document_verification_document_number', with: '12345678Z'
click_button 'Check' click_button 'Check'
expect(page).to_not have_content "This user account is already verified." expect(page).to_not have_content "This user account is already verified."
@@ -62,7 +62,7 @@ feature 'Users' do
expect(level_2_user.reload.erase_reason).to eq "Deleted by manager: manager_user_#{Manager.last.user_id}" expect(level_2_user.reload.erase_reason).to eq "Deleted by manager: manager_user_#{Manager.last.user_id}"
visit management_document_verifications_path visit management_document_verifications_path
fill_in 'document_verification_document_number', with: '13579' fill_in 'document_verification_document_number', with: '12345678Z'
click_button 'Check' click_button 'Check'
expect(page).to have_content "no user account associated to it" expect(page).to have_content "no user account associated to it"