Skip to content

Commit

Permalink
fix #13
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderUngefug committed Dec 16, 2022
1 parent 813c986 commit 79a42ca
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions spec/features/request/accept_lend_request_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require "rails_helper"

describe "Requests handling", type: :feature do

it "owner can start lending by accepting the request" do
owner = create(:max)
borrower = create(:peter)
item = create(:item, owner: owner.id)
sign_in borrower
visit item_path(item)
click_button('Lend')
expect(item.reload.lend_status).to eq('pending_lend_request')
sign_in owner
visit notifications_path
click_button('Check')
click_button('Accept')
expect(item.reload.lend_status).to eq('lent')
end
end

0 comments on commit 79a42ca

Please sign in to comment.