works_cited 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -128,42 +128,38 @@ module WorksCited
128
128
  end
129
129
 
130
130
  describe 'PATCH /preview' do
131
- describe 'when admin' do
132
- context 'with valid parameters' do
133
- it 'previews the Citation' do
134
- patch preview_citation_url, params: { citation: valid_attributes }
135
- expect(response).to be_successful
136
- end
131
+ context 'with valid parameters' do
132
+ it 'previews the Citation' do
133
+ patch preview_citation_url, params: { citation: valid_attributes }
134
+ expect(response).to be_successful
137
135
  end
138
136
  end
139
137
  end
140
138
 
141
139
  describe 'POST /create' do
142
- describe 'when admin' do
143
- context 'with valid parameters' do
144
- it 'creates a new Citation' do
145
- expect do
146
- post citations_url, params: { citation: valid_attributes }
147
- end.to change(Citation, :count).by(1)
148
- end
149
-
150
- it 'redirects to the created citation' do
140
+ context 'with valid parameters' do
141
+ it 'creates a new Citation' do
142
+ expect do
151
143
  post citations_url, params: { citation: valid_attributes }
152
- expect(response).to redirect_to(citation_url(Citation.last))
153
- end
144
+ end.to change(Citation, :count).by(1)
154
145
  end
155
146
 
156
- context 'with invalid parameters' do
157
- it 'does not create a new Citation' do
158
- expect do
159
- post citations_url, params: { citation: invalid_attributes }
160
- end.to change(Citation, :count).by(0)
161
- end
147
+ it 'redirects to the created citation' do
148
+ post citations_url, params: { citation: valid_attributes }
149
+ expect(response).to redirect_to(citation_url(Citation.last))
150
+ end
151
+ end
162
152
 
163
- it "renders a successful response (i.e. to display the 'new' template)" do
153
+ context 'with invalid parameters' do
154
+ it 'does not create a new Citation' do
155
+ expect do
164
156
  post citations_url, params: { citation: invalid_attributes }
165
- expect(response).to be_successful
166
- end
157
+ end.to change(Citation, :count).by(0)
158
+ end
159
+
160
+ it "renders a successful response (i.e. to display the 'new' template)" do
161
+ post citations_url, params: { citation: invalid_attributes }
162
+ expect(response).to be_successful
167
163
  end
168
164
  end
169
165
  end
@@ -172,46 +168,42 @@ module WorksCited
172
168
  let(:new_attributes) do
173
169
  { citation_type: 'book', title: 'New Title', record_id: doodad.id, record_type: 'Doodad' }
174
170
  end
175
- describe 'when admin' do
176
- context 'with valid parameters' do
177
- it 'updates the requested citation' do
178
- patch citation_url(citation), params: { citation: new_attributes }
179
- citation.reload
180
- expect(citation.title).to eq('New Title')
181
- end
182
-
183
- it 'redirects to the citation' do
184
- patch citation_url(citation), params: { citation: new_attributes }
185
- citation.reload
186
- expect(response).to redirect_to(citation_url(citation))
187
- end
171
+ context 'with valid parameters' do
172
+ it 'updates the requested citation' do
173
+ patch citation_url(citation), params: { citation: new_attributes }
174
+ citation.reload
175
+ expect(citation.title).to eq('New Title')
188
176
  end
189
177
 
190
- context 'with invalid parameters' do
191
- it "renders a successful response (i.e. to display the 'edit' template)" do
192
- patch citation_url(citation), params: { citation: invalid_attributes }
193
- expect(response).to be_successful
194
- end
178
+ it 'redirects to the citation' do
179
+ patch citation_url(citation), params: { citation: new_attributes }
180
+ citation.reload
181
+ expect(response).to redirect_to(citation_url(citation))
195
182
  end
196
183
  end
197
- end
198
184
 
199
- describe 'DELETE /destroy' do
200
- describe 'when admin' do
201
- before do
202
- citation # Call it up so it exists ahead of time
185
+ context 'with invalid parameters' do
186
+ it "renders a successful response (i.e. to display the 'edit' template)" do
187
+ patch citation_url(citation), params: { citation: invalid_attributes }
188
+ expect(response).to be_successful
203
189
  end
190
+ end
191
+ end
204
192
 
205
- it 'destroys the requested citation' do
206
- expect do
207
- delete citation_url(citation)
208
- end.to change(Citation, :count).by(-1)
209
- end
193
+ describe 'DELETE /destroy' do
194
+ before do
195
+ citation # Call it up so it exists ahead of time
196
+ end
210
197
 
211
- it 'redirects to the citations list' do
198
+ it 'destroys the requested citation' do
199
+ expect do
212
200
  delete citation_url(citation)
213
- expect(response).to redirect_to(citations_url)
214
- end
201
+ end.to change(Citation, :count).by(-1)
202
+ end
203
+
204
+ it 'redirects to the citations list' do
205
+ delete citation_url(citation)
206
+ expect(response).to redirect_to(citations_url)
215
207
  end
216
208
  end
217
209
  end
data/works_cited.gemspec CHANGED
@@ -2,19 +2,20 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: works_cited 0.1.7 ruby lib
5
+ # stub: works_cited 0.1.8 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "works_cited".freeze
9
- s.version = "0.1.7"
9
+ s.version = "0.1.8"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.metadata = { "source_code_uri" => "http://github.com/gemvein/works_cited" } if s.respond_to? :metadata=
13
13
  s.require_paths = ["lib".freeze]
14
14
  s.authors = ["Loren Lundgren".freeze]
15
- s.date = "2021-09-09"
15
+ s.date = "2021-09-10"
16
16
  s.description = "Works cited allows you to add a list of the works cited in ActiveRecord objects, to be formatted by a helper that can be added to relevant pages to format the citations like a bibliography.".freeze
17
17
  s.email = "loren.lundgren@gmail.com".freeze
18
+ s.executables = ["rails".freeze]
18
19
  s.extra_rdoc_files = [
19
20
  "LICENSE.txt",
20
21
  "README.md"
@@ -58,6 +59,7 @@ Gem::Specification.new do |s|
58
59
  "app/views/works_cited/citations/preview.html.haml",
59
60
  "app/views/works_cited/citations/show.html.haml",
60
61
  "app/views/works_cited/contributors/_fields.html.haml",
62
+ "bin/rails",
61
63
  "config/initializers/simple_form.rb",
62
64
  "config/locales/simple_form.en.yml",
63
65
  "config/routes.rb",
@@ -165,7 +167,7 @@ Gem::Specification.new do |s|
165
167
  "spec/factories/contributors.rb",
166
168
  "spec/factories/doodads.rb",
167
169
  "spec/factories/users.rb",
168
- "spec/helpers/works_cited/works_cited_helper_spec.rb",
170
+ "spec/helpers/works_cited/application_helper_spec.rb",
169
171
  "spec/models/doodad_spec.rb",
170
172
  "spec/models/thing_spec.rb",
171
173
  "spec/models/works_cited/citation_spec.rb",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: works_cited
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Lundgren
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-09 00:00:00.000000000 Z
11
+ date: 2021-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -324,7 +324,8 @@ description: Works cited allows you to add a list of the works cited in ActiveRe
324
324
  objects, to be formatted by a helper that can be added to relevant pages to format
325
325
  the citations like a bibliography.
326
326
  email: loren.lundgren@gmail.com
327
- executables: []
327
+ executables:
328
+ - rails
328
329
  extensions: []
329
330
  extra_rdoc_files:
330
331
  - LICENSE.txt
@@ -368,6 +369,7 @@ files:
368
369
  - app/views/works_cited/citations/preview.html.haml
369
370
  - app/views/works_cited/citations/show.html.haml
370
371
  - app/views/works_cited/contributors/_fields.html.haml
372
+ - bin/rails
371
373
  - config/initializers/simple_form.rb
372
374
  - config/locales/simple_form.en.yml
373
375
  - config/routes.rb
@@ -475,7 +477,7 @@ files:
475
477
  - spec/factories/contributors.rb
476
478
  - spec/factories/doodads.rb
477
479
  - spec/factories/users.rb
478
- - spec/helpers/works_cited/works_cited_helper_spec.rb
480
+ - spec/helpers/works_cited/application_helper_spec.rb
479
481
  - spec/models/doodad_spec.rb
480
482
  - spec/models/thing_spec.rb
481
483
  - spec/models/works_cited/citation_spec.rb