-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a328a3
commit 90cf12f
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# frozen_string_literal: true | ||
|
||
require "system_helper" | ||
|
||
RSpec.describe "Leaves" do | ||
fixtures :all | ||
let(:user) { users(:john) } | ||
|
||
it "creates and edits inventory" do | ||
travel_to "2022-02-02" | ||
login :admin | ||
visit user_path(user) | ||
click_on "add" | ||
within ".modal" do | ||
fill_in "Name", with: "MacBook Pro M3" | ||
screenshot "add_inventory" | ||
click_on "Save" | ||
end | ||
|
||
expect(page).not_to have_selector ".modal" | ||
expect(page).to have_content "MacBook Pro M3" | ||
expect(page).to have_content "February 02, 2022" | ||
|
||
click_on "MacBook Pro M3" | ||
within ".modal" do | ||
fill_in "Returned at", with: DateTime.current | ||
click_on "Save" | ||
end | ||
|
||
expect(page).not_to have_selector ".modal" | ||
expect(page).to have_selector ".muted" | ||
|
||
click_on "MacBook Pro M3" | ||
click_on "Delete" | ||
|
||
expect(page).not_to have_content "MacBook Pro M3" | ||
end | ||
end |