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.
Admins can now associate auctions with customers
Vendors can see who the auction is associated with
- Loading branch information
Jacob Harris
committed
Jul 6, 2016
1 parent
71b4c22
commit f10d5c1
Showing
15 changed files
with
126 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,8 @@ def auction_params | |
:start_price, | ||
:summary, | ||
:title, | ||
:type | ||
:type, | ||
:customer_id | ||
) | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class AddCustomerIdToAuctions < ActiveRecord::Migration | ||
def change | ||
add_column :auctions, :customer_id, :integer | ||
add_index :auctions, :customer_id | ||
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,45 @@ | ||
Feature: Admin associates customer with auction | ||
As an administrator | ||
I want to be able to associate auctions with customers | ||
So that users and admins can see who is creating certain projects | ||
|
||
Scenario: Associating an auction with a customer | ||
Given I am an administrator | ||
And I sign in | ||
And there is an open auction | ||
And there is a customer | ||
And I visit the auctions admin page | ||
|
||
When I click to edit the auction | ||
Then I should see a select box with all the customers in the system | ||
|
||
When I select a customer on the form | ||
And I click on the "Update" button | ||
Then I expect the customer to have been saved | ||
|
||
When I click to edit the auction | ||
Then I should see the customer selected for the auction | ||
|
||
Scenario: Seeing the customer on the auction page | ||
Given I am an administrator | ||
And I sign in | ||
And there is an auction with an associated customer | ||
When I visit the auction page | ||
Then I should see the customer name on the page | ||
|
||
When I visit the admin auction page for that auction | ||
Then I should see the customer name on the page | ||
|
||
Scenario: Vendor sees the customer | ||
Given I am a user with a verified SAM account | ||
And I sign in | ||
And there is an auction with an associated customer | ||
When I visit the auction page | ||
Then I should see the customer name on the page | ||
|
||
Scenario: Do not display the customer label if not set | ||
Given I am a user with a verified SAM account | ||
And I sign in | ||
And there is an open auction | ||
When I visit the auction page | ||
Then I should not see a label for the customer on the page |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Given(/^there is a customer$/) do | ||
@customer = FactoryGirl.create(:customer) | ||
end | ||
|
||
Then(/^I should see the customer name on the page$/) do | ||
page.find('p.auction-label-info', text: @customer.agency_name) | ||
end | ||
|
||
Then(/^I should not see a label for the customer on the page$/) do | ||
expect(page.first('h6', text: 'Customer')).to be_nil | ||
end |