|
9 | 9 | end
|
10 | 10 |
|
11 | 11 | after do
|
12 |
| - ActiveRecord::Base.store_base_sti_class = @old_store_base_sti_class |
| 12 | + ActiveRecord::Base.store_base_sti_class = @old_store_base_sti_class # rubocop:disable RSpec/InstanceVariable |
13 | 13 | end
|
14 | 14 |
|
15 | 15 | describe 'test_polymorphic_belongs_to_assignment_with_inheritance' do
|
16 | 16 | context 'when assigning a saved record' do
|
17 |
| - let(:post) { SpecialPost.create(title: 'Budget Forecasts Bigger 2011 Deficit', body: "the body") } |
| 17 | + let(:post) { SpecialPost.create(title: 'Budget Forecasts Bigger 2011 Deficit', body: 'the body') } |
18 | 18 | let(:tagging) { Tagging.new }
|
19 | 19 |
|
20 | 20 | it do
|
|
25 | 25 | end
|
26 | 26 |
|
27 | 27 | context 'when assigning a new record' do
|
28 |
| - let(:post) { SpecialPost.new(title: 'Budget Forecasts Bigger 2011 Deficit', body: "the body") } |
| 28 | + let(:post) { SpecialPost.new(title: 'Budget Forecasts Bigger 2011 Deficit', body: 'the body') } |
29 | 29 | let(:tagging) { Tagging.new }
|
30 | 30 |
|
31 | 31 | it do
|
|
37 | 37 | end
|
38 | 38 |
|
39 | 39 | describe 'test_polymorphic_has_many_create_model_with_inheritance' do
|
40 |
| - let(:post) { SpecialPost.new(title: 'Budget Forecasts Bigger 2011 Deficit', body: "the body") } |
| 40 | + let(:post) { SpecialPost.new(title: 'Budget Forecasts Bigger 2011 Deficit', body: 'the body') } |
41 | 41 | let(:misc_tag) { Tag.create(name: 'Misc') }
|
42 | 42 |
|
43 | 43 | it do
|
|
50 | 50 | end
|
51 | 51 |
|
52 | 52 | describe 'test_polymorphic_has_one_create_model_with_inheritance' do
|
53 |
| - let(:post) { SpecialPost.new(title: 'Budget Forecasts Bigger 2011 Deficit', body: "the body") } |
| 53 | + let(:post) { SpecialPost.new(title: 'Budget Forecasts Bigger 2011 Deficit', body: 'the body') } |
54 | 54 | let(:misc_tag) { Tag.create(name: 'Misc') }
|
55 | 55 |
|
56 | 56 | it do
|
|
76 | 76 | let(:tag) { SpecialTag.create!(name: 'Special') }
|
77 | 77 |
|
78 | 78 | it do
|
79 |
| - tag.polytagged_posts.create!(title: 'To Be or Not To Be?', body: "the body") |
| 79 | + tag.polytagged_posts.create!(title: 'To Be or Not To Be?', body: 'the body') |
80 | 80 |
|
81 | 81 | expect(tag.polytaggings.first.polytag_type).to eq 'SpecialTag'
|
82 | 82 | end
|
83 | 83 | end
|
84 | 84 |
|
85 | 85 | describe 'include_polymorphic_has_one' do
|
86 |
| - let(:post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: "the body") } |
| 86 | + let(:post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: 'the body') } |
87 | 87 | let(:misc_tag) { Tag.create(name: 'Misc') }
|
88 | 88 |
|
89 | 89 | it do
|
|
96 | 96 |
|
97 | 97 | describe 'include_polymorphic_has_many' do
|
98 | 98 | let(:tag) { SpecialTag.create!(name: 'Special') }
|
99 |
| - let(:post) { SpecialPost.create(title: 'Thinking', body: "the body") } |
100 |
| - let(:special_post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: "the body") } |
| 99 | + let(:post) { SpecialPost.create(title: 'Thinking', body: 'the body') } |
| 100 | + let(:special_post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: 'the body') } |
101 | 101 |
|
102 | 102 | it do
|
103 | 103 | tag.polytagged_posts << special_post
|
|
110 | 110 |
|
111 | 111 | describe 'include_polymorphic_has_many_through' do
|
112 | 112 | let(:tag) { SpecialTag.create!(name: 'Special') }
|
113 |
| - let(:post) { SpecialPost.create(title: 'Thinking', body: "the body") } |
114 |
| - let(:special_post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: "the body") } |
| 113 | + let(:post) { SpecialPost.create(title: 'Thinking', body: 'the body') } |
| 114 | + let(:special_post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: 'the body') } |
115 | 115 |
|
116 | 116 | it do
|
117 | 117 | tag.polytagged_posts << special_post
|
|
124 | 124 |
|
125 | 125 | describe 'join_polymorhic_has_many' do
|
126 | 126 | let(:tag) { SpecialTag.create!(name: 'Special') }
|
127 |
| - let(:post) { SpecialPost.create(title: 'Thinking', body: "the body") } |
128 |
| - let(:special_post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: "the body") } |
| 127 | + let(:post) { SpecialPost.create(title: 'Thinking', body: 'the body') } |
| 128 | + let(:special_post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: 'the body') } |
129 | 129 |
|
130 | 130 | it do
|
131 | 131 | tag.polytagged_posts << special_post
|
|
137 | 137 |
|
138 | 138 | describe 'join_polymorhic_has_many_through' do
|
139 | 139 | let(:tag) { SpecialTag.create!(name: 'Special') }
|
140 |
| - let(:post) { SpecialPost.create(title: 'Thinking', body: "the body") } |
141 |
| - let(:special_post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: "the body") } |
| 140 | + let(:post) { SpecialPost.create(title: 'Thinking', body: 'the body') } |
| 141 | + let(:special_post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: 'the body') } |
142 | 142 |
|
143 | 143 | it do
|
144 | 144 | tag.polytagged_posts << special_post
|
|
150 | 150 |
|
151 | 151 | describe 'has_many_through_polymorphic_has_one' do
|
152 | 152 | let(:author) { Author.create!(name: 'Bob') }
|
153 |
| - let(:post) { Post.create!(title: 'Budget Forecasts Bigger 2011 Deficit', author: author, body: "the body") } |
154 |
| - let(:special_post) { SpecialPost.create!(title: 'IBM Watson' 's Jeopardy play', author: author, body: "the body") } |
| 153 | + let(:post) { Post.create!(title: 'Budget Forecasts Bigger 2011 Deficit', author: author, body: 'the body') } |
| 154 | + let(:special_post) { SpecialPost.create!(title: 'IBM Watsons Jeopardy play', author: author, body: 'the body') } |
155 | 155 | let(:special_tag) { SpecialTag.create!(name: 'SpecialGeneral') }
|
156 | 156 |
|
157 | 157 | it do
|
|
162 | 162 |
|
163 | 163 | describe 'has_many_polymorphic_with_source_type' do
|
164 | 164 | let(:tag) { SpecialTag.create!(name: 'Special') }
|
165 |
| - let(:post) { SpecialPost.create(title: 'Thinking', body: "the body") } |
166 |
| - let(:special_post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: "the body") } |
| 165 | + let(:post) { SpecialPost.create(title: 'Thinking', body: 'the body') } |
| 166 | + let(:special_post) { SpecialPost.create!(title: 'Budget Forecasts Bigger 2011 Deficit', body: 'the body') } |
167 | 167 |
|
168 | 168 | it do
|
169 | 169 | tag.polytagged_posts << special_post
|
|
180 | 180 |
|
181 | 181 | describe 'test_polymorphic_has_many_through_with_double_sti_on_join_model' do
|
182 | 182 | let(:tag) { SpecialTag.create!(name: 'Special') }
|
183 |
| - let(:post) { SpecialPost.create(title: 'Thinking', body: "the body") } |
| 183 | + let(:post) { SpecialPost.create(title: 'Thinking', body: 'the body') } |
184 | 184 |
|
185 | 185 | it do
|
186 | 186 | tag.polytagged_posts << post
|
|
210 | 210 |
|
211 | 211 | describe 'where_query' do
|
212 | 212 | let(:tag) { SpecialTag.create!(name: 'Special') }
|
213 |
| - let(:post) { SpecialPost.create(title: 'Thinking', body: "the body") } |
| 213 | + let(:post) { SpecialPost.create(title: 'Thinking', body: 'the body') } |
214 | 214 |
|
215 | 215 | it do
|
216 | 216 | tag.polytagged_posts << post
|
|
0 commit comments