Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Mar 6, 2024
1 parent baa40f1 commit 8c6cfdb
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 37 deletions.
6 changes: 3 additions & 3 deletions app/controllers/english_offers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create
if turbo_frame_request?
render turbo_stream: turbo_stream.action(:redirect, root_path)
else
redirect_to root_path, status: :see_other
redirect_to root_path, status: :see_other and return
end
end

Expand All @@ -60,13 +60,13 @@ def create
@offer.errors.full_messages.join('; ')
end

redirect_to root_path
redirect_to root_path and return
end
else
@show_checkbox_recaptcha = true unless @success
flash.now[:alert] = t('english_offers.form.captcha_verification')

redirect_to root_path, status: :see_other
redirect_to root_path, status: :see_other and return
end
end

Expand Down
8 changes: 0 additions & 8 deletions test/controllers/daily_summary_controller_test.rb

This file was deleted.

4 changes: 1 addition & 3 deletions test/integration/english_offers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ def test_user_cannot_create_bid_less_than_starting_price
}
}

post auction_english_offers_path(auction_uuid: @auction.uuid),
params: params,
headers: { "HTTP_REFERER" => root_path }
post auction_english_offers_path(auction_uuid: @auction.uuid), params: params

assert @auction.offers.empty?
end
Expand Down
4 changes: 0 additions & 4 deletions test/integration/google_analytics_test.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
require 'application_system_test_case'

class GoogleAnalyticsIntegrationTest < ActionDispatch::IntegrationTest
def setup
patch cookies_path, params: { cookies: 'accepted', analytics_selected: '1' }
end

def test_google_analytics_integration
tracking_id = 'test-tracking-id'
Rails.configuration.customization[:google_analytics][:tracking_id] = tracking_id
Expand Down
2 changes: 1 addition & 1 deletion test/models/offer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_offer_must_be_higher_than_minimum_value_allowed_in_settings
offer.billing_profile = @billing_profile

assert_not(offer.valid?)
assert_equal(['must be higher than 5,00'], offer.errors[:price])
assert_equal(['Price must be higher than 5,00'], offer.errors[:price])

offer.cents = 500
assert(offer.valid?)
Expand Down
2 changes: 1 addition & 1 deletion test/models/wishlist_item_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_domain_name_must_be_a_valid_domain

item = WishlistItem.new(user: @user, domain_name: 'some')
assert_not(item.valid?)
assert_equal(['is invalid'], item.errors[:domain_name])
assert_equal(['Domain name is invalid'], item.errors[:domain_name])
end

def test_domain_has_valid_extension
Expand Down
17 changes: 3 additions & 14 deletions test/system/auctions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_if_user_click_to_offer_open_modal_window_for_blind_auction
visit('/')

within("tr[data-platform='english']", match: :first) do
assert(page.has_content?(:visible, '0.0 €'))
assert(page.has_content?(:visible, '0,00 €'))

click_link_or_button(I18n.t('auctions.bid'))
end
Expand All @@ -49,17 +49,6 @@ def test_if_user_click_to_offer_open_modal_window_for_english_auction
assert_selector('.c-modal', visible: true)
end

def test_subscribe_to_notifications
sign_in @user

visit('/')

assert(page.has_content?(:visible, I18n.t('auctions.subscribe_for_notifications')))
click_link_or_button(I18n.t('auctions.subscribe_for_notifications'))

assert(page.has_content?(:visible, I18n.t('auctions.unsubscribe_for_notifications')))
end

def test_show_all
sign_in @user

Expand Down Expand Up @@ -124,7 +113,7 @@ def test_autobider_available_only_for_english_type_auctions
visit('/')

within("tr[data-platform='english']", match: :first) do
assert(page.has_content?(:visible, '0.0 €'))
assert(page.has_content?(:visible, '0,00 €'))

click_link_or_button(I18n.t('auctions.bid'))
end
Expand Down Expand Up @@ -162,7 +151,7 @@ def test_user_can_set_autobider_and_unset_autobider
visit('/')

within("tr[data-platform='english']", match: :first) do
assert(page.has_content?(:visible, '0.0 €'))
assert(page.has_content?(:visible, '0,00 €'))

click_link_or_button(I18n.t('auctions.bid'))
end
Expand Down
6 changes: 3 additions & 3 deletions test/system/billing_profiles_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def test_user_can_change_his_billing_profile
postal_code_field = find('#input4', match: :first)
assert_equal @billing_profile.postal_code, postal_code_field.value
assert postal_code_field[:readonly]

find("a.c-btn.c-btn--ghost.c-btn--icon[href='/billing_profiles/762b09cb-bf40-4cf7-bdab-09cf677d0d0f/edit']").click

# c-btn c-btn--ghost c-btn--icon
find("a.c-btn.c-btn--ghost.c-btn--icon[href='#{edit_billing_profile_path(billing_profile.uuid)}']").click
# TODO:
# Here should be wot turbo request format

Expand Down

0 comments on commit 8c6cfdb

Please sign in to comment.