Skip to content

Commit

Permalink
TEST: Grant access to edit a document to a user (see #7).
Browse files Browse the repository at this point in the history
Co-Authored-By: petitfa1 <[email protected]>
  • Loading branch information
2 people authored and benel committed Jul 10, 2024
1 parent 2756b43 commit aef7b5c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
8 changes: 8 additions & 0 deletions features/step_definitions/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,11 @@
click_on_icon('typeIcon')
fill_element('#searchType', type)
end

Quand("j'essaie d'accorder les droits d'édition à {string}") do |userName|
find(".more-btn > button").trigger("click")
find(".dropdown-item-share").click
find(".add-user-input").fill_in with: userName
find(".add-user-input-btn").click
end

27 changes: 27 additions & 0 deletions features/step_definitions/outcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,30 @@
expect(find('.list-group')).not_to have_content "Ethnography/Interview"
end

Alors('bill peut modifier le document') do
sign_out
sign_in('bill', 'madhatter')
find('.editable.content').click
find('textarea').fill_in with: 'content'
leave_textarea
expect(find('.editable.content', match: :first).text).to match 'content'
end

Alors('alice ne peut pas modifier le document') do
sign_out
sign_in('alice', 'whiterabbit')
find('.editable.content').click
find('textarea').fill_in with: 'content'
leave_textarea
expect(page).not_to have_selector('.editable.content', text: 'content')
end

Alors('bill ne peut pas modifier le document') do
sign_out
sign_in('bill', 'madhatter')
find('.editable.content').click
find('textarea').fill_in with: 'content'
leave_textarea
expect(page).not_to have_selector('.editable.content', text: 'content')
end

0 comments on commit aef7b5c

Please sign in to comment.