Files
old-holivud2/spec/features/guest_account_signup_spec.rb
2020-09-13 20:09:48 +02:00

55 lines
1.5 KiB
Ruby

require "rails_helper"
feature "Guest account sign up" do
scenario "guest can select ME Suite PRO in 'interested in' dropdown" do
visit new_account_path
expect(page).to have_selector("img[src*='ME_PRO_black']")
select "ME Suite PRO", from: interested_in_product_dropdown
end
scenario "creates a new account and signs in successfully" do
visit new_account_path
fill_in "Email", with: "user+1@test.com"
fill_in "Password", with: "password"
fill_in "Account Name", with: "Test Account"
click_on "Start Free Trial"
expect(page).to have_content "We are excited to help you organize and automate your media projects. Click below to create your first project and get started."
expect(page).to have_content "Welcome"
expect(page).to have_link "Create Your First Project"
end
scenario "navivates to new account page when account creation fails" do
visit new_account_path
fill_in "Email", with: "user+1@test.com"
fill_in "Password", with: "password"
fill_in "Account Name", with: ""
click_on "Start Free Trial"
expect(page).to have_content "Sign Up"
end
scenario "navivates to new account page when user creation fails" do
visit new_account_path
fill_in "Email", with: ""
fill_in "Password", with: "password"
fill_in "Account Name", with: "Test Account"
click_on "Start Free Trial"
expect(page).to have_content "Sign Up"
end
private
def interested_in_product_dropdown
"user[interested_product_name]"
end
end