diff --git a/spec/features/management/managed_users_spec.rb b/spec/features/management/managed_users_spec.rb index 83382b101..78010bc39 100644 --- a/spec/features/management/managed_users_spec.rb +++ b/spec/features/management/managed_users_spec.rb @@ -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 diff --git a/spec/features/management/proposals_spec.rb b/spec/features/management/proposals_spec.rb index 8d256f67d..2764efca7 100644 --- a/spec/features/management/proposals_spec.rb +++ b/spec/features/management/proposals_spec.rb @@ -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)