mirror of https://github.com/fspc/BikeShed-1.git
Jason Denney
11 years ago
2 changed files with 42 additions and 7 deletions
@ -0,0 +1,32 @@ |
|||||
|
require 'spec_helper' |
||||
|
|
||||
|
describe "Index Page" do |
||||
|
|
||||
|
before(:each) do |
||||
|
@user = FactoryGirl.create(:bike_admin) |
||||
|
visit root_path |
||||
|
fill_in "user_username", with: @user.username |
||||
|
fill_in "user_password", with: @user.password |
||||
|
end |
||||
|
|
||||
|
it 'should have a link to check in' do |
||||
|
page.should have_button 'CHECK IN' |
||||
|
end |
||||
|
|
||||
|
it 'should have a link to check out' do |
||||
|
page.should have_button 'CHECK OUT' |
||||
|
end |
||||
|
|
||||
|
it 'clicking check in should check in a user' do |
||||
|
expect{click_button 'CHECK IN'}. |
||||
|
to change{@user.checked_in?}. |
||||
|
from(false).to(true) |
||||
|
end |
||||
|
|
||||
|
it 'clicking check out should check out a user' do |
||||
|
@user.checkin |
||||
|
expect{click_button 'CHECK OUT'}. |
||||
|
to change{@user.checked_in?}. |
||||
|
from(true).to(false) |
||||
|
end |
||||
|
end |
Loading…
Reference in new issue