Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
Admin should see bid label for open auctions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Harris committed Oct 13, 2016
1 parent e3868d7 commit 0935130
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/presenters/bidding_status_presenter/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def label
''
end

def bid_label(_user)
''
end

def tag_data_value_status
''
end
Expand Down
4 changes: 4 additions & 0 deletions app/view_models/admin/auction_show_view_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def html_summary
MarkdownRender.new(auction.summary).to_s
end

def bid_label
bidding_status_presenter.bid_label(current_user)
end

private

def eligibility_label
Expand Down
5 changes: 3 additions & 2 deletions app/views/admin/auctions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
<%= render partial: @view_model.csv_report_partial,
locals: { auction: @view_model } %>
</div>
</div>
<div class="auction-subtitles">
<div class="auction-subtitle">
<div class="bidding-status">
<%= render partial: 'auctions/bidding_status_label',
Expand All @@ -20,6 +18,9 @@
<div class="auction-subtitle">
<%= @view_model.relative_time %>
</div>
<div class="auction-subtitle">
<%= @view_model.bid_label %>
</div>
</div>
</div>

Expand Down
4 changes: 4 additions & 0 deletions features/admin_views_open_auction.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ Feature: Admin views open auction
And I sign in
When I visit the admin auction page for that auction
Then I should see the open auction message for admins
And I should see the current winning bid in a header subtitle

When I visit the auction page
Then I should see the open auction message for admins
And I should see the current winning bid in a header subtitle

Scenario: There is an open auction for the other purchase card
Given there is an open auction
And the auction is for a different purchase card
And I am an administrator
And I sign in

When I visit the admin auction page for that auction
Then I should see the open auction message for admins
And I should see the current winning bid in a header subtitle
1 change: 1 addition & 0 deletions features/step_definitions/label_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
Then(/^I should see a relative closing time for the auction$/) do
relative_time = DcTimePresenter.new(@auction.ended_at).relative_time
expect(page).to have_content("Closes #{relative_time}")
end

Then(/^I should see the current winning bid in a header subtitle$/) do
within(:css, '.auction-subtitles') do
Expand Down

0 comments on commit 0935130

Please sign in to comment.