works_cited 0.1.6 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/VERSION +1 -1
- data/app/models/works_cited/citation.rb +21 -0
- data/app/models/works_cited/contributor.rb +14 -0
- 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 -6
- metadata +6 -6
- data/spec/dummy/package.json +0 -5
- data/spec/dummy/yarn.lock +0 -8
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.10 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.10"
|
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-13"
|
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",
|
@@ -150,7 +152,6 @@ Gem::Specification.new do |s|
|
|
150
152
|
"spec/dummy/log/.keep",
|
151
153
|
"spec/dummy/log/development.log",
|
152
154
|
"spec/dummy/log/test.log",
|
153
|
-
"spec/dummy/package.json",
|
154
155
|
"spec/dummy/public/404.html",
|
155
156
|
"spec/dummy/public/422.html",
|
156
157
|
"spec/dummy/public/500.html",
|
@@ -162,12 +163,11 @@ Gem::Specification.new do |s|
|
|
162
163
|
"spec/dummy/tmp/development_secret.txt",
|
163
164
|
"spec/dummy/tmp/pids/.keep",
|
164
165
|
"spec/dummy/tmp/storage/.keep",
|
165
|
-
"spec/dummy/yarn.lock",
|
166
166
|
"spec/factories/citations.rb",
|
167
167
|
"spec/factories/contributors.rb",
|
168
168
|
"spec/factories/doodads.rb",
|
169
169
|
"spec/factories/users.rb",
|
170
|
-
"spec/helpers/works_cited/
|
170
|
+
"spec/helpers/works_cited/application_helper_spec.rb",
|
171
171
|
"spec/models/doodad_spec.rb",
|
172
172
|
"spec/models/thing_spec.rb",
|
173
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.10
|
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-13 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
|
@@ -460,7 +462,6 @@ files:
|
|
460
462
|
- spec/dummy/log/.keep
|
461
463
|
- spec/dummy/log/development.log
|
462
464
|
- spec/dummy/log/test.log
|
463
|
-
- spec/dummy/package.json
|
464
465
|
- spec/dummy/public/404.html
|
465
466
|
- spec/dummy/public/422.html
|
466
467
|
- spec/dummy/public/500.html
|
@@ -472,12 +473,11 @@ files:
|
|
472
473
|
- spec/dummy/tmp/development_secret.txt
|
473
474
|
- spec/dummy/tmp/pids/.keep
|
474
475
|
- spec/dummy/tmp/storage/.keep
|
475
|
-
- spec/dummy/yarn.lock
|
476
476
|
- spec/factories/citations.rb
|
477
477
|
- spec/factories/contributors.rb
|
478
478
|
- spec/factories/doodads.rb
|
479
479
|
- spec/factories/users.rb
|
480
|
-
- spec/helpers/works_cited/
|
480
|
+
- spec/helpers/works_cited/application_helper_spec.rb
|
481
481
|
- spec/models/doodad_spec.rb
|
482
482
|
- spec/models/thing_spec.rb
|
483
483
|
- spec/models/works_cited/citation_spec.rb
|
data/spec/dummy/package.json
DELETED
data/spec/dummy/yarn.lock
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
2
|
-
# yarn lockfile v1
|
3
|
-
|
4
|
-
|
5
|
-
"@oddcamp/cocoon-vanilla-js@^1.1.2":
|
6
|
-
version "1.1.2"
|
7
|
-
resolved "https://registry.yarnpkg.com/@oddcamp/cocoon-vanilla-js/-/cocoon-vanilla-js-1.1.2.tgz#2b05b584802b36b95722eaf346a54ed43d822a1a"
|
8
|
-
integrity sha512-X0gW+cSAMH8j/BCWT9JS6gH4qbfvWmuLGIT0DWyo/Sop7GKwG+qzwURZVVdUVkYjg0+duxUg3n9P6W7FHNcpgQ==
|