Skip to content

Commit

Permalink
basic spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JensRavens committed Mar 26, 2024
1 parent 1a328a3 commit 90cf12f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions spec/system/inventories_spec.rb
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

0 comments on commit 90cf12f

Please sign in to comment.