Skip to content

Commit

Permalink
Test the user experience in organization creation
Browse files Browse the repository at this point in the history
So we check the message with the verification link is present and
administrators see the organization in the admin section.
  • Loading branch information
javierm committed Apr 15, 2021
1 parent 75b8d87 commit 112aba5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions spec/system/organizations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

describe "Organizations" do
scenario "Organizations can be created" do
user = User.organizations.find_by(email: "green@peace.com")
expect(user).not_to be
admin = create(:administrator).user

visit new_organization_registration_path

Expand All @@ -16,10 +15,17 @@

click_button "Register"

user = User.organizations.find_by(email: "green@peace.com")
expect(user).to be
expect(user).to be_organization
expect(user.organization).not_to be_verified
expect(page).to have_content "You have been sent a message containing a verification link"

logout
login_as admin

visit admin_users_path

within "tr", text: "Greenpeace" do
expect(page).to have_text "organization"
expect(page).to have_text "level_1_user"
end
end

scenario "Create with invisible_captcha honeypot field", :no_js do
Expand Down

0 comments on commit 112aba5

Please sign in to comment.