-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix system tests for when billing is enabled (#787)
* hack * Local gems * Add billing gems * Update capybara logic for subscribing to a plan * Fix invitations test when billing is enabled * Reset local gems * Revert hack back to develop * Update more tests to pass with billing enabled * Remove unneeded line from helper in application system test case * Finish fixing tests for updated pricing page * Fix remaining tests * Remove local gems * Fix fields system test * Refactor system tests with billing * Add TODO for fields system test * More edits to fields test
- Loading branch information
Showing
16 changed files
with
150 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,12 +15,6 @@ class AccountManagementSystemTest < ApplicationSystemTestCase | |
fill_in "Confirm Password", with: example_password | ||
click_on "Sign Up" | ||
|
||
if billing_enabled? | ||
unless freemium_enabled? | ||
complete_pricing_page | ||
end | ||
end | ||
|
||
# we should now be on an onboarding step. | ||
assert page.has_content?("Tell us about you") | ||
fill_in "First Name", with: "Testy" | ||
|
@@ -29,6 +23,12 @@ class AccountManagementSystemTest < ApplicationSystemTestCase | |
page.select "Brisbane", from: "Your Time Zone" | ||
click_on "Next" | ||
|
||
if billing_enabled? | ||
unless freemium_enabled? | ||
complete_pricing_page | ||
end | ||
end | ||
|
||
assert page.has_content?("The Testing Team’s Dashboard") | ||
|
||
user = User.find_by(email: "[email protected]") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,13 @@ class AccountTest < ApplicationSystemTestCase | |
|
||
visit root_path | ||
|
||
# TODO: This is an ugly hack to ensure the default test user isn't logged in. | ||
# This is happening when billing is enabled and the entire test suite is run. | ||
if page.text.match?("Jane Smith") | ||
sign_out_for(display_details) | ||
visit root_path | ||
end | ||
|
||
invitation_only? ? be_invited_to_sign_up : click_on("Don't have an account?") | ||
assert page.has_content?("Create Your Account") | ||
fill_in "Your Email Address", with: "[email protected]" | ||
|
@@ -20,6 +27,12 @@ class AccountTest < ApplicationSystemTestCase | |
page.select "Brisbane", from: "Your Time Zone" | ||
click_on "Next" | ||
|
||
if billing_enabled? | ||
unless freemium_enabled? | ||
complete_pricing_page | ||
end | ||
end | ||
|
||
click_on "Add New Creative Concept" | ||
fill_in "Name", with: "My Generic Creative Concept" | ||
fill_in "Description", with: "Dummy description for my creative concept" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,20 @@ def setup | |
super | ||
@jane = create :onboarded_user, first_name: "Jane", last_name: "Smith" | ||
@john = create :onboarded_user, first_name: "John", last_name: "Smith", email: "[email protected]" | ||
|
||
login_as(@jane, scope: :user) | ||
visit root_path | ||
if billing_enabled? | ||
unless freemium_enabled? | ||
complete_pricing_page | ||
sleep 2 | ||
end | ||
end | ||
end | ||
|
||
@@test_devices.each do |device_name, display_details| | ||
test "admin can create new non admin invitation on a #{device_name}" do | ||
resize_for(display_details) | ||
login_as(@jane, scope: :user) | ||
visit new_account_team_invitation_path(@jane.current_team) | ||
fill_in "Email", with: "[email protected]" | ||
click_on "Create Invitation" | ||
|
@@ -21,7 +29,6 @@ def setup | |
|
||
test "admin can create new admin invitation on a #{device_name}" do | ||
resize_for(display_details) | ||
login_as(@jane, scope: :user) | ||
visit new_account_team_invitation_path(@jane.current_team) | ||
fill_in "Email", with: "[email protected]" | ||
check "Invite as Team Administrator" | ||
|
@@ -33,7 +40,6 @@ def setup | |
|
||
test "admin can't create invalid invitation on a #{device_name}" do | ||
resize_for(display_details) | ||
login_as(@jane, scope: :user) | ||
visit new_account_team_invitation_path(@jane.current_team) | ||
fill_in "Email", with: "" | ||
click_on "Create Invitation" | ||
|
@@ -43,7 +49,6 @@ def setup | |
|
||
test "admin can cancel invitation on a #{device_name}" do | ||
resize_for(display_details) | ||
login_as(@jane, scope: :user) | ||
membership = Membership.new(team: @jane.current_team, user_email: @john.email) | ||
create :invitation, team: @jane.current_team, from_membership: @jane.memberships.first, email: @john.email, membership: membership | ||
visit account_team_invitations_path(@jane.current_team) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.