adds spec for managed user info in management

This commit is contained in:
Juanjo Bazán
2015-10-23 13:56:44 +02:00
committed by Juanjo Bazán
parent 97dcd02750
commit bdb9e1a45e
2 changed files with 28 additions and 0 deletions

View File

@@ -8,6 +8,11 @@ feature 'Managed User' do
context "Currently managed user" do
scenario "No managed user" do
visit management_document_verifications_path
expect(page).not_to have_css ".account-info"
end
scenario "User is already level three verified" do
user = create(:user, :level_three)
@@ -55,6 +60,15 @@ feature 'Managed User' do
fill_in 'document_verification_document_number', with: '1234'
click_button 'Check'
within(".account-info") do
expect(page).not_to have_content "Identified as"
expect(page).not_to have_content "Username"
expect(page).not_to have_content "Email"
expect(page).to have_content "Document type"
expect(page).to have_content "Document number"
expect(page).to have_content "1234"
end
expect(page).to have_content "Please introduce the email used on the account"
fill_in 'email_verification_email', with: user.email

View File

@@ -14,6 +14,13 @@ feature 'Proposals' do
click_link "Create proposal"
within(".account-info") do
expect(page).to have_content "Identified as"
expect(page).to have_content "#{user.username}"
expect(page).to have_content "#{user.email}"
expect(page).to have_content "#{user.document_number}"
end
fill_in 'proposal_title', with: 'Help refugees'
fill_in 'proposal_question', with: '¿Would you like to give assistance to war refugees?'
fill_in 'proposal_summary', with: 'In summary, what we want is...'
@@ -83,6 +90,13 @@ feature 'Proposals' do
expect(current_path).to eq(management_proposals_path)
within(".account-info") do
expect(page).to have_content "Identified as"
expect(page).to have_content "#{user.username}"
expect(page).to have_content "#{user.email}"
expect(page).to have_content "#{user.document_number}"
end
within("#proposals") do
expect(page).to have_css('.proposal', count: 2)
expect(page).to have_css("a[href='#{management_proposal_path(proposal1)}']", text: proposal1.title)