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 'faye' | |
| require File.dirname(__FILE__) + '/main' | |
| Sinatra::Base.set(:run, false) | |
| Sinatra::Base.set(:env, ENV['RACK_ENV']) | |
| use Faye::RackAdapter, :mount => '/faye', :timeout => 45 | |
| run Sinatra::Application |
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
| Fabricator(:candidate) do | |
| first_name "John" | |
| last_name "Doe" | |
| phone "555-222-3333" | |
| email "[email protected]" | |
| github "moo" | |
| twitter "chirp" | |
| local true | |
| willing_to_relocate false | |
| added_on "2009-01-22" |
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 CreateCandidates < ActiveRecord::Migration | |
| def self.up | |
| create_table :candidates do |t| | |
| t.string :first_name | |
| t.string :last_name | |
| t.string :phone | |
| t.string :email | |
| t.string :github | |
| t.string :twitter | |
| t.boolean :local |
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
| module NavigationHelpers | |
| # Maps a name to a path. Used by the | |
| # | |
| # When /^I go to (.+)$/ do |page_name| | |
| # | |
| # step definition in web_steps.rb | |
| # | |
| def path_to(page_name) | |
| case page_name |
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 |
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
| %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
| 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
| class Candidate < ActiveRecord::Base | |
| def full_name | |
| [first_name, last_name].join(' ') | |
| end | |
| end |
OlderNewer