mirror of https://github.com/fspc/BikeShed-1.git
Jason Denney
11 years ago
3 changed files with 31 additions and 9 deletions
@ -0,0 +1,23 @@ |
|||||
|
require "spec_helper" |
||||
|
|
||||
|
feature "TimeEntries" do |
||||
|
let!(:user){ FactoryGirl.create(:user) } |
||||
|
let!(:entry){ FactoryGirl.create(:time_entry, loggable_id: user.id) } |
||||
|
|
||||
|
before(:each) do |
||||
|
visit new_user_session_path |
||||
|
fill_in "user_username", with: user.username |
||||
|
fill_in "user_password", with: user.password |
||||
|
click_button "Sign in" |
||||
|
end |
||||
|
|
||||
|
scenario "User deletes a time entry", js: true do |
||||
|
visit time_entries_path |
||||
|
puts TimeEntry.where(loggable_id: user.id).inspect |
||||
|
save_screenshot("/tmp/testingpoop.png") |
||||
|
find('button.work_entry-delete-btn').trigger('click') |
||||
|
click_button "Delete" |
||||
|
expect(page).to have_text("Your Timesheet") |
||||
|
expect(TimeEntry.count).to eql 0 |
||||
|
end |
||||
|
end |
Loading…
Reference in new issue