This repository has been archived by the owner on Jul 30, 2019. It is now read-only.
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
Showing
23 changed files
with
115 additions
and
204 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
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
<%= render partial: auction.winning_bidder_partial, | ||
locals: { auction: auction } %> | ||
<span class="issue-winning-bid"> | ||
<%= auction.highlighted_bid_amount_as_currency %> | ||
</span> | ||
Winning bid: <%= auction.highlighted_bid_amount_as_currency %> |
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
app/views/auctions/_reverse_auction_user_is_winning_bidder.html.erb
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
app/views/auctions/_sealed_bid_auction_user_is_bidder.html.erb
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
app/views/auctions/_sealed_bid_auction_user_is_winning_bidder.html.erb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Starting price: <%= auction.starting_price %> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
app/views/auctions/_user_is_not_current_winning_bidder.html.erb
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
<%= render partial: auction.current_winning_bidder_partial, | ||
locals: { auction: auction } %> | ||
<%= auction.highlighted_bid_amount_as_currency %> | ||
Current winning bid: <%= auction.highlighted_bid_amount_as_currency %> |
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
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,29 +1,40 @@ | ||
require 'rails_helper' | ||
|
||
describe StatusPresenter::Available do | ||
context "when the auction is available" do | ||
let(:presenter) { StatusPresenter::Available.new(auction) } | ||
let(:auction) do | ||
a = create( | ||
:auction, | ||
started_at: Time.now - 3.days, | ||
ended_at: Time.now + 2.days, | ||
start_price: 3500 | ||
) | ||
create(:bid, auction: a, amount: 3000) | ||
a | ||
end | ||
|
||
describe '#tag_data_value_status' do | ||
it "has a twitter status data value with human readable time expression" do | ||
presenter = StatusPresenter::Available.new(auction) | ||
expect(presenter.tag_data_value_status).to eq("2 days left") | ||
end | ||
end | ||
|
||
describe '#tag_data_label_2' do | ||
it "has a twitter second label that indicates bidding is open" do | ||
presenter = StatusPresenter::Available.new(auction) | ||
expect(presenter.tag_data_label_2).to eq("Bidding") | ||
end | ||
end | ||
|
||
describe '#tag_data_value_2' do | ||
it "has some weird value associated with the bidding label" do | ||
presenter = StatusPresenter::Available.new(auction) | ||
expect(presenter.tag_data_value_2).to eq("$3,000.00 - 1 bids") | ||
end | ||
end | ||
|
||
describe '#relative_time' do | ||
it 'returns time remaining' do | ||
presenter = StatusPresenter::Available.new(auction) | ||
expect(presenter.relative_time).to eq("Ending in 2 days") | ||
end | ||
end | ||
|
||
def auction | ||
@_auction ||= create( | ||
:auction, | ||
:available, | ||
start_price: 3500, | ||
bids: [create(:bid, amount: 3000)] | ||
) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
require 'rails_helper' | ||
|
||
describe StatusPresenter::Expiring do | ||
context "when the auction is expiring soon" do | ||
let(:presenter) { StatusPresenter::Expiring.new(auction) } | ||
let(:auction) do | ||
a = create( | ||
:auction, | ||
started_at: Time.now - 3.days, | ||
ended_at: Time.now + 3.hours, | ||
start_price: 3500 | ||
) | ||
create(:bid, amount: 3000, auction: a) | ||
a | ||
end | ||
describe '#label_class' do | ||
it 'returns the correct label class' do | ||
auction = build(:auction) | ||
|
||
it "has a twitter status data value with human readable time expression" do | ||
expect(presenter.tag_data_value_status).to eq("about 3 hours left") | ||
end | ||
presenter = StatusPresenter::Expiring.new(auction) | ||
|
||
it "has a twitter second label that indicates bidding is open" do | ||
expect(presenter.tag_data_label_2).to eq("Bidding") | ||
expect(presenter.label_class).to eq 'auction-label-expiring' | ||
end | ||
end | ||
|
||
describe '#label' do | ||
it 'returns the correct label' do | ||
auction = build(:auction) | ||
|
||
presenter = StatusPresenter::Expiring.new(auction) | ||
|
||
it "has some weird value associated with the bidding label" do | ||
expect(presenter.tag_data_value_2).to eq("$3,000.00 - 1 bids") | ||
expect(presenter.label).to eq 'Expiring' | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,45 @@ | ||
require 'rails_helper' | ||
|
||
describe StatusPresenter::Future do | ||
context "when the auction is in the future" do | ||
let(:presenter) { StatusPresenter::Future.new(auction) } | ||
let(:auction) do | ||
a = create( | ||
:auction, | ||
started_at: Time.now + 3.day, | ||
ended_at: Time.now + 3.hours, | ||
start_price: 3500 | ||
) | ||
create(:bid, auction: a, amount: 3000) | ||
a | ||
end | ||
|
||
it "has a twitter status data value with human readable time expression" do | ||
describe '#tag_data_value_status' do | ||
it "returns human readable time" do | ||
presenter = StatusPresenter::Future.new(auction) | ||
expect(presenter.tag_data_value_status).to eq("in 3 days") | ||
end | ||
end | ||
|
||
it "has a twitter second label about the starting bid amount" do | ||
describe '#tag_data_label_2' do | ||
it "returns starting bid" do | ||
presenter = StatusPresenter::Future.new(auction) | ||
expect(presenter.tag_data_label_2).to eq("Starting bid") | ||
end | ||
end | ||
|
||
it "has some weird value associated with the bidding label" do | ||
describe '#tag_data_value_2' do | ||
it "returns start price" do | ||
presenter = StatusPresenter::Future.new(auction) | ||
expect(presenter.tag_data_value_2).to eq("$3,500.00") | ||
end | ||
end | ||
|
||
describe '#relative_time' do | ||
it 'returns time until auction starts' do | ||
time = Time.current + 1.day | ||
auction = create(:auction, :future, ended_at: time) | ||
|
||
presenter = StatusPresenter::Future.new(auction) | ||
|
||
expect(presenter.relative_time).to eq 'Starting in about 23 hours' | ||
end | ||
end | ||
|
||
def auction | ||
@_auction ||= create( | ||
:auction, | ||
:future, | ||
started_at: Time.now + 3.days, | ||
start_price: 3500, | ||
bids: [create(:bid, amount: 3000)] | ||
) | ||
end | ||
end |
Oops, something went wrong.