This file contains hidden or 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
| ProofingOven::Application.routes.draw do | |
| match 'ui(/:action)', controller: 'ui' | |
| root to: 'ui#index' | |
| resources :candidates, only: [:index] do | |
| collection do | |
| post :search | |
| end | |
| end |
This file contains hidden or 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
| .search | |
| = form_tag search_candidates_path, method: :post do | |
| %fieldset | |
| = text_field_tag :search, params[:search] | |
| = submit_tag "Search" | |
| %table.standard | |
| %thead | |
| %tr | |
| - ["Name", "Phone", "Email", "Github", "Twitter", "Local", "Willing to Relocate"].each do |th| |
This file contains hidden or 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
| @http://www.pivotaltracker.com/story/show/16870693 @candidates @filtering | |
| Feature: User searches for candidate by name | |
| In order to locate a candidate | |
| As a user viewing candidates | |
| I want search by name | |
| - Candidates page displays text field for search | |
| - Submitting form filters on first and last name | |
| Background: |
This file contains hidden or 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
| class CandidatesController < ApplicationController | |
| expose(:candidates) { Candidate.order(:first_name) } | |
| end |
This file contains hidden or 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
| @http://www.pivotaltracker.com/story/show/18733537 @candidates | |
| Feature: User views candidates | |
| In order to hire amazing people | |
| As a signed in user | |
| I want to see a list of candidates | |
| - Candidates page displays all candidates | |
| - Sorted by last name, first name | |
| - Fields displayed include: | |
| -- Name (last, first) |
This file contains hidden or 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
| class Candidate < ActiveRecord::Base | |
| def full_name | |
| [first_name, last_name].join(' ') | |
| end | |
| end |
This file contains hidden or 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
| require 'spec_helper' | |
| describe Candidate do | |
| subject { Fabricate(:candidate, first_name: "Joe", last_name: "Doe") } | |
| describe "#full_name" do | |
| its(:full_name) { should == "Joe Doe" } | |
| end | |
| end |
This file contains hidden or 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
| %table.standard | |
| %thead | |
| %tr | |
| - ["Name", "Phone", "Email", "Github", "Twitter", "Local", "Willing to Relocate"].each do |th| | |
| %th= th | |
| %tbody | |
| - candidates.each do |candidate| | |
| %tr | |
| %td= candidate.full_name | |
| %td= candidate.phone |
This file contains hidden or 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
| class CandidatesController < ApplicationController | |
| expose(:candidates) { Candidate.all } | |
| end |
This file contains hidden or 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
| ProofingOven::Application.routes.draw do | |
| match 'ui(/:action)', controller: 'ui' | |
| root to: 'ui#index' | |
| resources :candidates, only: [:index] | |
| end |