This repository has been archived by the owner on Jul 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work_in_progress status for admin auction show
- Loading branch information
Jacob Harris
committed
Sep 2, 2016
1 parent
1cf69b0
commit fa6c9ed
Showing
8 changed files
with
70 additions
and
1 deletion.
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
28 changes: 28 additions & 0 deletions
28
app/presenters/admin_auction_status_presenter/work_in_progress.rb
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,28 @@ | ||
class AdminAuctionStatusPresenter::WorkInProgress < AdminAuctionStatusPresenter::Base | ||
def header | ||
I18n.t('statuses.admin_auction_status_presenter.work_in_progress.header') | ||
end | ||
|
||
def body | ||
I18n.t( | ||
'statuses.admin_auction_status_presenter.work_in_progress.body', | ||
winner_url: winner_url, | ||
delivery_url: auction.delivery_url, | ||
delivery_deadline: delivery_deadline | ||
) | ||
end | ||
|
||
private | ||
|
||
def winner_url | ||
Url.new( | ||
link_text: winner.email, | ||
path_name: 'admin_user', | ||
params: { id: winner.id } | ||
) | ||
end | ||
|
||
def delivery_deadline | ||
DcTimePresenter.convert_and_format(auction.delivery_due_at) | ||
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
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,11 @@ | ||
Feature: Admin views work in progress auction | ||
As an administrator | ||
I want to see that an auction is a work in progress | ||
So I can know what the delivery URL is | ||
|
||
Scenario: Viewing a work in progress auction on its admin show page | ||
Given I am an administrator | ||
And I am signed in | ||
And there is an auction with work in progress | ||
When I visit the admin auction page for that auction | ||
Then I should see the work in progress status box for admins |
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