hydra-batch-edit 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69ea091b00ff503bd8818b9a8aee327d4e830b63
4
- data.tar.gz: dd061b36c841a8143150dac1ea9da388e491b0e5
3
+ metadata.gz: 49eb4f38e25d7b886f7069572baa623ea0602172
4
+ data.tar.gz: ed6a555e20a829174d1fd90ef11080601afe9a3a
5
5
  SHA512:
6
- metadata.gz: bd47ffb0ad55b19d8b8bfc66dd5593f88e679c2283082a8967d01f84c5776e3fb29f569610c76d8096f4a1eec265a175f7c2ec2ca0c710c12c81aa27b75a8c74
7
- data.tar.gz: 4e0251902312a7ed1808b4c638861762612ea1f8662f524920b0b045e58d1090a599c10192dd03f80d986ef266644d19ec20434a0f9f1c25c50b31c0a652cbcc
6
+ metadata.gz: aba85956838b2f175908c1e8c80b84906d010bf8cccb2fb7861b601c8653098987b7d100880561193a38fdc05fa5f1fdf513422979423672219690b9f008be94
7
+ data.tar.gz: 28ae45abf6af7337460cdc7e9a4525ef2a6d0068de06ade7335d0aaca3a397fb28aea80156489a5abbc1336e01c1615c0ba2a2996f703ee346c4b04619a467d9
@@ -1,4 +1,3 @@
1
- require: rubocop-rspec
2
1
  inherit_from: .rubocop_todo.yml
3
2
 
4
3
  AllCops:
@@ -1,3 +1,4 @@
1
+ require: rubocop-rspec
1
2
  # This configuration was generated by
2
3
  # `rubocop --auto-gen-config`
3
4
  # on 2016-04-20 07:34:46 -0700 using RuboCop version 0.39.0.
@@ -53,6 +54,10 @@ Lint/Void:
53
54
  Metrics/MethodLength:
54
55
  Max: 17
55
56
 
57
+ RSpec/VerifiedDoubles:
58
+ Exclude:
59
+ - 'spec/controllers/batch_edits_controller_spec.rb'
60
+
56
61
  # Offense count: 1
57
62
  RSpec/AnyInstance:
58
63
  Exclude:
@@ -1,5 +1,11 @@
1
1
  rvm:
2
2
  - 2.2.4
3
3
 
4
+ env:
5
+ global:
6
+ - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
7
+ matrix:
8
+ - "RAILS_VERSION=4.2.7.1"
9
+
4
10
  notifications:
5
11
  irc: "irc.freenode.org#projecthydra"
@@ -5,8 +5,8 @@ module Hydra
5
5
  included do
6
6
  include CurationConcerns::Collections::AcceptsBatches
7
7
 
8
- before_filter :filter_docs_with_access!, :only=>[:edit, :update, :destroy_collection]
9
- before_filter :check_for_empty!, :only=>[:edit, :update, :destroy_collection]
8
+ before_action :filter_docs_with_access!, :only=>[:edit, :update, :destroy_collection]
9
+ before_action :check_for_empty!, :only=>[:edit, :update, :destroy_collection]
10
10
  end
11
11
 
12
12
  # fetch the documents that match the ids in the folder
@@ -1,5 +1,5 @@
1
1
  module Hydra
2
2
  module BatchEdit
3
- VERSION = "2.0.2".freeze
3
+ VERSION = "2.1.0".freeze
4
4
  end
5
5
  end
@@ -43,18 +43,25 @@ describe BatchEditsController do
43
43
 
44
44
  end
45
45
  it "should complain when none are in the batch " do
46
- put :update, :multiresimage=>{:titleSet_display=>'My title' }
46
+ put :update, :multiresimage=>{:titleSet_display=>'My title' }
47
47
  expect(response).to redirect_to 'where_i_came_from'
48
48
  expect(flash[:notice]).to eq("Select something first")
49
49
  end
50
- it "should not update when the user doesn't have permissions" do
51
- controller.batch = [@one.pid, @two.pid]
52
- expect(controller).to receive(:can?).with(:edit, @one.pid).and_return(false)
53
- expect(controller).to receive(:can?).with(:edit, @two.pid).and_return(false)
54
- put :update, :multiresimage=>{:titleSet_display=>'My title' }
55
- expect(response).to redirect_to 'where_i_came_from'
56
- expect(flash[:notice]).to eq("You do not have permission to edit the documents: #{@one.pid}, #{@two.pid}")
50
+
51
+ context "when the user doesn't have permissions" do
52
+ before do
53
+ controller.batch = [@one.pid, @two.pid]
54
+ end
55
+
56
+ it "should not update when the user doesn't have permissions" do
57
+ expect(controller).to receive(:can?).with(:edit, @one.pid).and_return(false)
58
+ expect(controller).to receive(:can?).with(:edit, @two.pid).and_return(false)
59
+ put :update, :multiresimage=>{:titleSet_display=>'My title' }
60
+ expect(response).to redirect_to 'where_i_came_from'
61
+ expect(flash[:notice]).to eq("You do not have permission to edit the documents: #{@one.pid}, #{@two.pid}")
62
+ end
57
63
  end
64
+
58
65
  describe "when current user has access to the documents" do
59
66
  before do
60
67
  @one.save
@@ -95,14 +102,21 @@ describe BatchEditsController do
95
102
  expect(response).to redirect_to 'where_i_came_from'
96
103
  expect(flash[:notice]).to eq("Select something first")
97
104
  end
98
- it "should not update when the user doesn't have permissions" do
99
- controller.batch = [@one.pid, @two.pid]
100
- expect(controller).to receive(:can?).with(:edit, @one.pid).and_return(false)
101
- expect(controller).to receive(:can?).with(:edit, @two.pid).and_return(false)
102
- delete :destroy_collection
103
- expect(response).to redirect_to 'where_i_came_from'
104
- expect(flash[:notice]).to eq("You do not have permission to edit the documents: #{@one.pid}, #{@two.pid}")
105
+
106
+ context "when the user doesn't have permissions" do
107
+ before do
108
+ controller.batch = [@one.pid, @two.pid]
109
+ end
110
+
111
+ it "does not update" do
112
+ expect(controller).to receive(:can?).with(:edit, @one.pid).and_return(false)
113
+ expect(controller).to receive(:can?).with(:edit, @two.pid).and_return(false)
114
+ delete :destroy_collection
115
+ expect(response).to redirect_to 'where_i_came_from'
116
+ expect(flash[:notice]).to eq("You do not have permission to edit the documents: #{@one.pid}, #{@two.pid}")
117
+ end
105
118
  end
119
+
106
120
  describe "when current user has access to the documents" do
107
121
  before do
108
122
  @one.save
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-batch-edit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-20 00:00:00.000000000 Z
12
+ date: 2016-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  version: '0'
193
193
  requirements: []
194
194
  rubyforge_project:
195
- rubygems_version: 2.4.5.1
195
+ rubygems_version: 2.5.1
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: Rails engine to do batch editing with curation_concerns