Skip to content

Commit

Permalink
Corrected system tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Tsoganov authored and Sergei Tsoganov committed Sep 22, 2023
1 parent 8a87f07 commit a67e471
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions config/locales/billing_profiles.et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ et:
errors: "seda arve aadressi ei saa salvestada"
in_use_by_offer_short: "Seotud mõne aktiivse pakkumisega"
in_use_by_offer: "Antud profiil on juba seotud mõne aktiivse pakkumisega"
created: "Arveldusprofiil edukalt loodud!"
updated: "Arveldusprofiil edukalt uuendatud!"
deleted: "Arveldusprofiil edukalt kustutatud!"

edit:
title: "Muuda arve aadressi"
Expand Down
10 changes: 5 additions & 5 deletions test/system/billing_profiles_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_a_user_can_create_billing_profile_for_a_vat_liable_company
click_link_or_button('Submit')
end

assert(page.has_css?('div.notice', text: 'Created successfully.'))
assert(page.has_css?('div.notice', text: 'Billing profile successfully created!'))
end

# def test_billing_profile_vat_code_needs_to_be_unique_for_user
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_a_user_can_create_company_billing_profile_witout_vat_code
.where(name: 'ACME corporation')
.where('vat_code IS NULL'))

assert(page.has_css?('div.notice', text: 'Created successfully.'))
assert(page.has_css?('div.notice', text: 'Billing profile successfully created!'))
end

def test_a_user_can_create_private_billing_profile
Expand All @@ -93,7 +93,7 @@ def test_a_user_can_create_private_billing_profile
click_link_or_button('Submit')
end

assert(page.has_css?('div.notice', text: 'Created successfully.'))
assert(page.has_css?('div.notice', text: 'Billing profile successfully created!'))
assert(BillingProfile.find_by(name: @user.display_name))
end

Expand All @@ -110,7 +110,7 @@ def test_a_user_can_edit_their_billing_profile
click_link_or_button('Submit')
end

assert(page.has_css?('div.notice', text: 'Updated successfully.'))
assert(page.has_css?('div.notice', text: 'Billing profile successfully updated!'))
assert(BillingProfile.find_by(street: 'New Street 12', name: 'Joe John Participant-New',
country_code: 'PL'))
end
Expand All @@ -130,7 +130,7 @@ def test_a_user_can_delete_their_unused_billing_profile
click_link_or_button('Delete')
end

assert_text('Deleted successfully.')
assert_text('Billing profile successfully deleted!')
end

def test_user_cannot_create_billing_profiles_in_the_name_of_other_user
Expand Down

0 comments on commit a67e471

Please sign in to comment.