File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,3 +23,11 @@ Feature: Viewing most recent editions in admin
2323 And I check the "Limit access to publishers from organisations associated with this document before you publish" box
2424 When I click "Save"
2525 Then I should see the validation error "Access can only be limited by users belonging to an organisation tagged to the document"
26+
27+ Scenario : Attempting to change organisation when document is access limited
28+ Given I am an editor in the organisation "Foo"
29+ And I create an access limited document
30+ When I set the Lead organisation to an org I am not in
31+ When I click "Save"
32+ Then I should see the validation error "Access can only be limited by users belonging to an organisation tagged to the document"
33+ And I should still be able to access the document
Original file line number Diff line number Diff line change 4141Then ( /^I should see the validation error "(.+)"$/ ) do |string |
4242 expect ( page ) . to have_content string
4343end
44+
45+ Given ( /^I create an access limited document$/ ) do
46+ step "I begin drafting a new document"
47+ step "I check the \" Limit access to publishers from organisations associated with this document before you publish\" box"
48+ step "I click \" Save\" "
49+ end
50+
51+ Then ( /^I should still be able to access the document$/ ) do
52+ visit current_url # refresh
53+ expect ( page ) . not_to have_content "You do not have permission to access this page."
54+ expect ( page ) . to have_content "Test publication"
55+ expect ( Edition . last . organisations ) . to eq ( [ @user . organisation ] )
56+ end
You can’t perform that action at this time.
0 commit comments