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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/rails +16 -0
- data/spec/dummy/config/routes.rb +4 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +1954 -0
- data/spec/helpers/works_cited/{works_cited_helper_spec.rb → application_helper_spec.rb} +0 -0
- data/spec/requests/works_cited/citations_spec.rb +49 -57
- data/works_cited.gemspec +6 -4
- metadata +6 -4
File without changes
|
@@ -128,42 +128,38 @@ module WorksCited
|
|
128
128
|
end
|
129
129
|
|
130
130
|
describe 'PATCH /preview' do
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
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
|
-
|
143
|
-
|
144
|
-
|
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
|
-
|
153
|
-
end
|
144
|
+
end.to change(Citation, :count).by(1)
|
154
145
|
end
|
155
146
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
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
|
-
|
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
|
-
|
166
|
-
|
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
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
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
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
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
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
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
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
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
|
-
|
198
|
+
it 'destroys the requested citation' do
|
199
|
+
expect do
|
212
200
|
delete citation_url(citation)
|
213
|
-
|
214
|
-
|
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.
|
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.
|
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-
|
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/
|
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.
|
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-
|
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/
|
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
|