-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9611968
commit 7632630
Showing
11 changed files
with
117 additions
and
81 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
4 changes: 2 additions & 2 deletions
4
app/components/pages/auction/notification_subscribe/component.html.erb
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<div class="c-table__filters__more"> | ||
<% if @current_user&.daily_summary %> | ||
<%= component 'common/links/link_button', link_title: t('auction.unsubscribe_for_notifications'), href: user_toggle_sub_path, color: 'ghost' %> | ||
<%= component 'common/links/link_button', link_title: t('auctions.unsubscribe_for_notifications'), href: user_toggle_sub_path, color: 'ghost' %> | ||
<% elsif @current_user %> | ||
<%= component 'common/links/link_button', link_title: t('auction.subscribe_for_notifications'), href: user_toggle_sub_path(@current_user), color: 'ghost' %> | ||
<%= component 'common/links/link_button', link_title: t('auctions.subscribe_for_notifications'), href: user_toggle_sub_path(@current_user), color: 'ghost' %> | ||
<% end %> | ||
</div> |
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 |
---|---|---|
@@ -1,109 +1,117 @@ | ||
require 'application_system_test_case' | ||
require "test_helper" | ||
|
||
class AuctionsTest < ApplicationSystemTestCase | ||
def setup | ||
super | ||
|
||
travel_to Time.parse('2010-07-05 10:40 +0000').in_time_zone | ||
|
||
@blind_auction = auctions(:valid_with_offers) | ||
@english_auction = auctions(:english) | ||
|
||
@user = users(:participant) | ||
end | ||
|
||
def test_if_anonymous_click_to_offer_he_redirect_to_login_page | ||
visit('/') | ||
|
||
click_link_or_button(I18n.t('auctions.bid'), match: :first) | ||
|
||
assert_current_path new_user_session_path | ||
end | ||
|
||
def test_if_user_click_to_offer_open_modal_window_for_blind_auction | ||
sign_in @user | ||
|
||
visit('/') | ||
|
||
within("tr[data-platform='english']", match: :first) do | ||
assert(page.has_content?(:visible, '0.0 €')) | ||
|
||
click_link_or_button(I18n.t('auctions.bid')) | ||
end | ||
|
||
assert_selector('.c-modal', visible: true) | ||
end | ||
|
||
def test_if_user_click_to_offer_open_modal_window_for_english_auction | ||
sign_in @user | ||
|
||
end | ||
visit('/') | ||
|
||
def test_user_can_sort_auctions | ||
within("#auction_#{@blind_auction.id}", match: :first) do | ||
assert(page.has_content?(:visible, @blind_auction.currently_winning_offer.price)) | ||
|
||
find('a.c-btn.c-btn--ghost.c-btn--icon', match: :first).click | ||
end | ||
|
||
assert_selector('.c-modal', visible: true) | ||
end | ||
|
||
def test_user_can_filter_auctions | ||
|
||
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 | ||
|
||
# include ActiveJob::TestHelper | ||
def test_show_all | ||
sign_in @user | ||
|
||
# def setup | ||
# super | ||
visit('/') | ||
|
||
# travel_to Time.parse('2010-07-05 10:30 +0000').in_time_zone | ||
# @auction = auctions(:valid_with_offers) | ||
# @other_auction = auctions(:valid_without_offers) | ||
# @expired_auction = auctions(:expired) | ||
# @orphaned_auction = auctions(:orphaned) | ||
# @english_auction = auctions(:english) | ||
# @english_nil_auction = auctions(:english_nil_starts) | ||
# end | ||
assert(page.has_content?(:visible, I18n.t('auctions.all_list'))) | ||
click_link_or_button(I18n.t('auctions.all_list')) | ||
|
||
# def teardown | ||
# super | ||
assert_current_path auctions_path + '?show_all=true' | ||
end | ||
|
||
# travel_back | ||
# end | ||
def test_sort_table | ||
# TODO: Stimulus actions not work in test mode | ||
# -------------------------------------------- | ||
|
||
# def test_auctions_index_contains_a_list | ||
# visit('/') | ||
# sign_in @user | ||
|
||
# assert(page.has_table?('auctions-table')) | ||
# assert(page.has_link?('with-offers.test', href: auction_path(@auction.uuid))) | ||
# assert(page.has_link?('no-offers.test', href: auction_path(@other_auction.uuid))) | ||
# assert(page.has_link?('english_auction.test', href: auction_path(@english_auction.uuid))) | ||
# assert(page.has_no_link?('english_nil_auction.test', href: auction_path(@english_nil_auction.uuid))) | ||
# end | ||
# visit('/') | ||
|
||
# def test_numbers_have_a_span_class_in_index_list | ||
# visit('/') | ||
# list_of_domain = page.all('tbody#bids tr.contents td:first-child').map(&:text) | ||
|
||
# assert(span_element = page.find('span.number-in-domain-name')) | ||
# assert_equal('123', span_element.text) | ||
# end | ||
# puts list_of_domain | ||
# puts '-----' | ||
|
||
# def test_numbers_have_a_span_class_in_show_view | ||
# visit(auction_path(@orphaned_auction.uuid)) | ||
# find('.sorting', text: I18n.t('auctions.domain_name', match: :first)).click | ||
|
||
# assert(span_element = page.find('span.number-in-domain-name')) | ||
# assert_equal('123', span_element.text) | ||
# end | ||
# list_of_domain = page.all('tbody#bids tr.contents td:first-child').map(&:text) | ||
|
||
# def test_auctions_index_contains_a_link_to_terms_and_conditions | ||
# visit('/') | ||
# puts list_of_domain | ||
end | ||
|
||
# assert( | ||
# page.has_link?('auctioning process', | ||
# href: 'https://www.internet.ee/help-and-info/faq#III__ee_domain_auctions') | ||
# ) | ||
def test_filter_auction_list | ||
# TODO: Stimulus actions not work in test mode | ||
# -------------------------------------------- | ||
|
||
# assert(page.has_link?('terms and conditions', href: Setting.find_by(code: 'terms_and_conditions_link').retrieve)) | ||
# end | ||
# sign_in @user | ||
|
||
# def test_auctions_index_does_not_contain_auctions_that_are_finished | ||
# visit('/') | ||
|
||
# assert_not(page.has_link?('expired.test')) | ||
# end | ||
# list_of_domain = page.all('tbody#bids tr.contents td:first-child').map(&:text) | ||
|
||
# def test_show_page_for_finished_auctions_still_exists | ||
# visit(auction_path(@expired_auction.uuid)) | ||
# assert(page.has_content?(:visible, 'This auction has finished')) | ||
# assert(page.has_content?(:visible, 'expired.test')) | ||
# end | ||
# puts list_of_domain | ||
# puts '-----' | ||
|
||
# def test_show_page_contains_the_details_of_the_auction | ||
# visit(auction_path(@auction.uuid)) | ||
# find('#domain_name').set('english_auction.test') | ||
# sleep 1 | ||
|
||
# assert(page.has_content?(:visible, 'with-offers.test')) | ||
# assert(page.has_content?(:visible, '2010-07-06 10:30')) | ||
# end | ||
|
||
# def test_for_english_auction_should_be_bid_button | ||
# visit('/') | ||
# list_of_domain = page.all('tbody#bids tr.contents td:first-child').map(&:text) | ||
|
||
# assert(page.has_link?('english_auction.test', href: auction_path(@english_auction.uuid))) | ||
# assert(page.has_link?('Bid!')) | ||
# end | ||
# puts list_of_domain | ||
# puts '-----' | ||
|
||
end | ||
end |
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