Skip to content

Commit

Permalink
Merge 6fcd9de into 00b34c4
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolalsvk committed Aug 26, 2016
2 parents 00b34c4 + 6fcd9de commit 1e6ffd8
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
17 changes: 17 additions & 0 deletions features/admin_publishes_auction.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,20 @@ Feature: Admin publishes auction in the admin panel
And the auction is for a different purchase card
When I visit the admin form for that auction
Then I should be able to set the auction to published

@javascript
Scenario: Admin creates and publishes auction with other purchase card
Given I am an administrator
And there is a client account to bill to
And there is a skill in the system
When I sign in
And I visit the auctions admin page
When I click on the add auction link
And I fill auction form with choosing "other" purchase card
Then I should see that the auction type is sealed bid
And I click to create an auction
Then I should see the auction's title

When I click on the auction's title
Then I should see the start time I set for the auction
And I should see the end time I set for the auction
45 changes: 45 additions & 0 deletions features/step_definitions/admin_auction_form_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,51 @@
select("reverse", from: "auction_type")
end

When(/^I fill auction form with choosing "([^"]*)" purchase card$/) do |purchase_card|
@title = 'This is the form-edited title'
fill_in("auction_title", with: @title)

@description = 'and the admin related stuff'
fill_in("auction_description", with: @description)

@repo = 'https://github.com/18F/calc'
fill_in('auction_github_repo', with: @repo)

@summary = 'The Summary!'
fill_in('auction_summary', with: @summary)

@issue_url = 'https://github.com/18F/calc/issues/255'
fill_in('auction_issue_url', with: @issue_url)

@start_day = DcTimePresenter.convert(3.days.from_now)
fill_in "auction_started_at", with: @start_day.strftime('%Y-%m-%d')
select('11', from: 'auction_started_at_1i')
select('30', from: 'auction_started_at_2i')
select('AM', from: 'auction_started_at_3i')
@start_time = DcTimePresenter.time_zone.parse("#{@start_day.strftime('%Y-%m-%d')} 11:30 AM")

@end_day = DcTimePresenter.convert(3.days.from_now)
fill_in "auction_ended_at", with: @end_day.strftime('%Y-%m-%d')
select('4', from: 'auction_ended_at_1i')
select('45', from: 'auction_ended_at_2i')
select('PM', from: 'auction_ended_at_3i')
@end_time = DcTimePresenter.time_zone.parse("#{@start_day.strftime('%Y-%m-%d')} 4:45 PM")

@time_in_days = 3
@deadline_day = DcTimePresenter.convert(@time_in_days.business_days.from_now)
select("6", from: "auction_due_in_days")

select("published", from: "auction_published")

select(purchase_card, from: "auction_purchase_card")

find('.selectize-control.select.optional.multi').click
find('.selectize-dropdown-content', text: @skill.name).click

find('.selectize-control.select.required.single').click
find('.selectize-dropdown-content', text: @billable.to_s).click
end

When(/^I edit the new auction form$/) do
@title = 'This is the form-edited title'
fill_in("auction_title", with: @title)
Expand Down

0 comments on commit 1e6ffd8

Please sign in to comment.