Skip to content

Commit

Permalink
fixed test, added parallelize to the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Jun 21, 2024
1 parent 01b278f commit 290039a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/locales/english_offers.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ en:
you_won: "You won"
you_lost: "Someone else won"
you_lose: 'You lost the auction'
new_bid: "New bid!"
new_bid: "New bid"

form:
bidder: "Bidder"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/english_offers.et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ et:
you_won: "Oled võitnud"
you_lost: "Teine pakkuja võitis"
you_lose: 'Kaotasid oksjoni'
new_bid: "Uus pakkumine!"
new_bid: "Uus pakkumine"

form:
bidder: "Pakkuja"
Expand Down
8 changes: 4 additions & 4 deletions test/components/common/notification_icon_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ def test_render_differnt_types

assert_selector "span.o-trophy-icon"
assert_selector "h5.c-notification__header__title" do
assert_text(/^You won! ?/)
assert_text(I18n.t('english_offers.index.you_won'))
assert_selector "span.o-new"
end

@notification.update(type: "AuctionLooserNotification") && @notification.reload
render_inline(Common::Notifications::Icon::Component.new(notification: @notification, readed: false))
assert_selector "span.o-hammer-icon"
assert_selector "h5.c-notification__header__title" do
assert_text(/^You Lose! ?/)
assert_text(I18n.t('english_offers.index.you_lose'))
assert_selector "span.o-new"
end

Expand All @@ -50,15 +50,15 @@ def test_render_differnt_types
render_inline(Common::Notifications::Icon::Component.new(notification: @notification, readed: true))
assert_selector "span.c-notification__header__icon.o-trophy-icon"
assert_selector "h5.c-notification__header__title" do
assert_text(/^You won! ?/)
assert_text(I18n.t('english_offers.index.you_won'))
assert_selector "span.o-new"
end

@notification.update(type: "AuctionLooserNotification") && @notification.reload
render_inline(Common::Notifications::Icon::Component.new(notification: @notification, readed: true))
assert_selector "span.c-notification__header__icon.o-hammer-icon"
assert_selector "h5.c-notification__header__title" do
assert_text(/^You Lose! ?/)
assert_text(I18n.t('english_offers.index.you_lose'))
assert_selector "span.o-new"
end

Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all

parallelize(workers: 4)

# Add more helper methods to be used by all tests here...
def clear_email_deliveries
ActionMailer::Base.deliveries.clear
Expand Down

0 comments on commit 290039a

Please sign in to comment.