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

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #987 from 18F/ad-attention-needed
Action items -> Needs attention auctions
  • Loading branch information
jessieay committed Aug 2, 2016
2 parents 7e8fd53 + 358f901 commit 05d6cce
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 31 deletions.
5 changes: 0 additions & 5 deletions app/controllers/admin/action_items_controller.rb

This file was deleted.

5 changes: 5 additions & 0 deletions app/controllers/admin/auctions/needs_attention_controller.rb
@@ -0,0 +1,5 @@
class Admin::Auctions::NeedsAttentionController < Admin::BaseController
def index
@view_model = Admin::NeedsAttentionAuctionsViewModel.new
end
end
2 changes: 1 addition & 1 deletion app/controllers/authentications_controller.rb
Expand Up @@ -33,7 +33,7 @@ def auth_hash

def redirect_back_or_root_path
if Admins.verify?(current_user.github_id)
redirect_to(return_to || admin_action_items_path)
redirect_to(return_to || admin_auctions_needs_attention_path)
else
redirect_to(return_to || root_path)
end
Expand Down
2 changes: 1 addition & 1 deletion app/view_models/admin/base_view_model.rb
Expand Up @@ -23,7 +23,7 @@ def drafts_nav_class
''
end

def action_items_nav_class
def needs_attention_auctions_nav_class
''
end

Expand Down
@@ -1,4 +1,4 @@
class Admin::ActionItemListItem < Admin::BaseViewModel
class Admin::NeedsAttentionAuctionListItem < Admin::BaseViewModel
attr_reader :auction

def initialize(auction)
Expand Down
@@ -1,5 +1,5 @@
class Admin::ActionItemsViewModel < Admin::BaseViewModel
def action_items_nav_class
class Admin::NeedsAttentionAuctionsViewModel < Admin::BaseViewModel
def needs_attention_auctions_nav_class
'usa-current'
end

Expand All @@ -26,6 +26,6 @@ def rejected
private

def list_items(auctions)
auctions.map { |auction| Admin::ActionItemListItem.new(auction) }
auctions.map { |auction| Admin::NeedsAttentionAuctionListItem.new(auction) }
end
end
2 changes: 1 addition & 1 deletion app/views/admin/_auctions_subnav.html.erb
Expand Up @@ -3,7 +3,7 @@
<nav class="site-nav-secondary">
<ul>
<li><%= link_to 'All', admin_auctions_path, class: view_model.auctions_nav_class %></li>
<li><%= link_to 'Action Items', admin_action_items_path, class: view_model.action_items_nav_class %></li>
<li><%= link_to 'Needs Attention', admin_auctions_needs_attention_path, class: view_model.needs_attention_auctions_nav_class %></li>
<li><%= link_to 'Draft Auctions', admin_drafts_path, class: view_model.drafts_nav_class %></li>
<li><%= link_to 'Closed', admin_auctions_closed_path, class: view_model.closed_auctions_nav_class %></li>
<li class='new-button'>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Expand Up @@ -20,13 +20,13 @@
namespace :admin do
resources :auction_reports, only: [:show]
resources :user_reports, only: [:index]
resources :action_items, only: [:index]
resources :drafts, only: [:index]
resources :proposals, only: [:create]
resources :users, only: [:show, :edit, :update]

namespace :auctions do
get '/closed', to: 'closed#index'
get '/needs_attention', to: 'needs_attention#index'
end

resources :auctions
Expand Down
2 changes: 1 addition & 1 deletion features/admin_signs_in.feature
Expand Up @@ -5,4 +5,4 @@ Feature: Admin signs in
Scenario: Admin signs in
Given I am an administrator
And I sign in
Then I should be on the admin action items page
Then I should be on the admin needs attention auctions page
16 changes: 8 additions & 8 deletions features/admin_views_action_items.feature
@@ -1,16 +1,16 @@
Feature: Admin view action items
Feature: Admin view needs attention auctions
As an admin
I want to see the action items dashboard
I want to see the needs attention auctions dashboard
So I can tell what actions I might need to take

Background:
Given I am an administrator
And I sign in

Scenario: Viewing the action items dashboard
Scenario: Viewing the needs attention auctions dashboard
Given there is a complete and successful auction
And there is also an unpublished auction
When I visit the admin action items page
When I visit the admin needs attention auctions page
Then I should see the name of the auction
And I should see the edit link for the auction

Expand All @@ -21,10 +21,10 @@ Feature: Admin view action items

Scenario: Viewing rejected auction
Given there is a rejected auction
When I visit the admin action items page
Then I should see the rejected auction as an action item
When I visit the admin needs attention auctions page
Then I should see the rejected auction as a needs attention auction

Scenario: Viewing rejected auction with no bids
Given there is a rejected auction with no bids
When I visit the admin action items page
Then I should see the rejected auction as an action item
When I visit the admin needs attention auctions page
Then I should see the rejected auction as a needs attention auction
@@ -1,5 +1,5 @@
Then(/^I should see the rejected auction as an action item$/) do
auction = Admin::ActionItemListItem.new(@auction)
Then(/^I should see the rejected auction as a needs attention auction$/) do
auction = Admin::NeedsAttentionAuctionListItem.new(@auction)

['Title', 'Delivery Deadline', 'Delivery URL', 'Vendor Name', 'Rejected At'].each_with_index do |header, i|
within(:xpath, th_xpath(table_id: 'table-rejected', column: i + 1)) do
Expand Down
8 changes: 4 additions & 4 deletions features/step_definitions/navigation_steps.rb
Expand Up @@ -34,8 +34,8 @@
visit edit_admin_auction_path(@auction)
end

When(/^I visit the admin action items page$/) do
visit admin_action_items_path
When(/^I visit the admin needs attention auctions page$/) do
visit admin_auctions_needs_attention_path
end

When(/^I visit the admin drafts page$/) do
Expand Down Expand Up @@ -118,8 +118,8 @@
expect(page.current_path).to eq(sign_up_path)
end

When(/^I should be on the admin action items page$/) do
expect(page.current_path).to eq admin_action_items_path
When(/^I should be on the admin needs attention auctions page$/) do
expect(page.current_path).to eq admin_auctions_needs_attention_path
end

When(/^I should be on the admin admins page$/) do
Expand Down
@@ -1,12 +1,12 @@
require 'rails_helper'

describe Admin::ActionItemListItem do
describe Admin::NeedsAttentionAuctionListItem do
describe '#c2_proposal_url' do
context 'auction for default purchase card' do
it 'returns c2 proposal URL' do
auction = create(:auction, purchase_card: :default)

view_model = Admin::ActionItemListItem.new(auction)
view_model = Admin::NeedsAttentionAuctionListItem.new(auction)

expect(view_model.c2_proposal_url).to eq auction.c2_proposal_url
end
Expand All @@ -16,7 +16,7 @@
it 'returns n/a' do
auction = create(:auction, purchase_card: :other)

view_model = Admin::ActionItemListItem.new(auction)
view_model = Admin::NeedsAttentionAuctionListItem.new(auction)

expect(view_model.c2_proposal_url).to eq 'N/A'
end
Expand Down

0 comments on commit 05d6cce

Please sign in to comment.