Skip to content

Commit

Permalink
Merge pull request #1181 from projecthydra/1-7-7-release
Browse files Browse the repository at this point in the history
Bump to version 1.7.7
  • Loading branch information
jrochkind committed Apr 24, 2017
2 parents f1e0b0b + aec8892 commit 1c74f6a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Expand Up @@ -4,7 +4,7 @@ module Workflow
# grants the creator the ability to alter it.
class GrantEditToDepositor
def self.call(target:, **)
target.edit_users = [target.depositor]
target.edit_users += [target.depositor]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/curation_concerns/version.rb
@@ -1,3 +1,3 @@
module CurationConcerns
VERSION = '1.7.5'.freeze
VERSION = '1.7.7'.freeze
end
Expand Up @@ -2,7 +2,6 @@

RSpec.describe CurationConcerns::Workflow::GrantEditToDepositor do
let(:depositor) { create(:user) }
let(:work) { create(:work_without_access, depositor: depositor.user_key) }
let(:user) { User.new }

describe ".call" do
Expand All @@ -12,9 +11,21 @@
user: user)
end

it "adds edit access " do
expect { subject }.to change { work.edit_users }.from([]).to([depositor.user_key])
expect(work).to be_valid
context "with no additional editors" do
let(:work) { create(:work_without_access, depositor: depositor.user_key) }
it "adds edit access" do
expect { subject }.to change { work.edit_users }.from([]).to([depositor.user_key])
expect(work).to be_valid
end
end

context "with an additional editor" do
let(:editor) { create(:user) }
let(:work) { create(:work_without_access, depositor: depositor.user_key, edit_users: [editor.user_key]) }
it "adds edit access" do
expect { subject }.to change { work.edit_users }.from([editor.user_key]).to([editor.user_key, depositor.user_key])
expect(work).to be_valid
end
end
end
end

0 comments on commit 1c74f6a

Please sign in to comment.