magazine 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +32 -0
- data/app/assets/javascripts/magazine/application.js +13 -0
- data/app/assets/stylesheets/magazine/application.css +15 -0
- data/app/controllers/magazine/application_controller.rb +4 -0
- data/app/controllers/magazine/articles_controller.rb +56 -0
- data/app/controllers/magazine/articles_controller.rb~ +55 -0
- data/app/helpers/magazine/application_helper.rb +30 -0
- data/app/helpers/magazine/application_helper.rb~ +30 -0
- data/app/models/magazine/data.rb~ +40 -0
- data/app/models/magazine/rack.rb +40 -0
- data/app/models/magazine/rack.rb~ +40 -0
- data/app/views/layouts/magazine/application.html.erb +14 -0
- data/config/routes.rb +5 -0
- data/config/routes.rb~ +5 -0
- data/lib/magazine.rb +8 -0
- data/lib/magazine.rb~ +8 -0
- data/lib/magazine/engine.rb +12 -0
- data/lib/magazine/engine.rb~ +13 -0
- data/lib/magazine/version.rb +3 -0
- data/lib/tasks/magazine_tasks.rake +4 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +9 -0
- data/spec/dummy/app/controllers/application_controller.rb~ +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/magazine/articles/index.html.erb +23 -0
- data/spec/dummy/app/views/magazine/articles/index.html.erb~ +23 -0
- data/spec/dummy/app/views/magazine/articles/shared/_list_article.html.erb +1 -0
- data/spec/dummy/app/views/magazine/articles/shared/_list_article.html.erb~ +1 -0
- data/spec/dummy/app/views/magazine/articles/shared/beans/_kilimanjaro.html.erb +1 -0
- data/spec/dummy/app/views/magazine/articles/shared/beans/_kilimanjaro.html.erb~ +0 -0
- data/spec/dummy/app/views/magazine/articles/shared/drip/_water.html.erb +1 -0
- data/spec/dummy/app/views/magazine/articles/shared/drip/_water.html.erb~ +0 -0
- data/spec/dummy/app/views/magazine/articles/show.html.erb +6 -0
- data/spec/dummy/app/views/magazine/articles/show.html.erb~ +6 -0
- data/spec/dummy/app/views/magazine/index.html.erb~ +7 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +23 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +78 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/magazine.rb +1 -0
- data/spec/dummy/config/initializers/magazine.rb~ +0 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/magazine.yml +48 -0
- data/spec/dummy/config/magazine.yml~ +48 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/routes.rb~ +4 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +1180 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/13ef700ed1b340ce31710c628c9b1506 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3c36df6af1863f67917951036d1d7221 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5bf1895db17a04b83c2f8c9bd096ca85 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7f4ca612f398e7c52f7fd934cddbaa50 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b9d7ea8e2449bbec7d43b6518403dc6c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ed792a88666afd4aff94594da589930e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/features/magazine/articles_spec.rb +109 -0
- data/spec/features/magazine/articles_spec.rb~ +109 -0
- data/spec/models/magazine/data.rb~ +5 -0
- data/spec/models/magazine/data_spec.rb~ +12 -0
- data/spec/models/magazine/rack_spec.rb +173 -0
- data/spec/models/magazine/rack_spec.rb~ +173 -0
- data/spec/rails_helper.rb +38 -0
- data/spec/rails_helper.rb~ +39 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/spec_helper.rb~ +86 -0
- metadata +306 -0
@@ -0,0 +1,173 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe Magazine::Rack do
|
4
|
+
let!(:magazine_rack) do
|
5
|
+
Magazine::Rack.new
|
6
|
+
end
|
7
|
+
|
8
|
+
describe '#initialize' do
|
9
|
+
subject do
|
10
|
+
magazine_rack.data.map(&:to_hash)
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should load config yml' do
|
14
|
+
expect(subject).to eq(
|
15
|
+
[{"category_slug"=>"drip",
|
16
|
+
"category_name"=>"ドリップ",
|
17
|
+
"extra"=>{"label_color"=>"orange"},
|
18
|
+
"articles"=>
|
19
|
+
[{"review"=>false,
|
20
|
+
"slug"=>"water",
|
21
|
+
"title"=>"ウォータードリップ",
|
22
|
+
"extra"=>{"excerpt"=>"専用の機材を用い水でコーヒーを抽出する方法。"}},
|
23
|
+
{"review"=>false,
|
24
|
+
"slug"=>"paper",
|
25
|
+
"title"=>"ペーパードリップ",
|
26
|
+
"extra"=>{"excerpt"=>"日本で最も普及していると思われる淹れ方。"}},
|
27
|
+
{"review"=>false,
|
28
|
+
"slug"=>"nel",
|
29
|
+
"title"=>"ネルドリップ",
|
30
|
+
"extra"=>{"excerpt"=>"フィルタとして布(綿フランネル)を使用する抽出法。"}}]},
|
31
|
+
{"category_slug"=>"beans",
|
32
|
+
"category_name"=>"コーヒー豆",
|
33
|
+
"extra"=>{"label_color"=>"green"},
|
34
|
+
"articles"=>
|
35
|
+
[{"review"=>true,
|
36
|
+
"slug"=>"blue-mountain",
|
37
|
+
"title"=>"ブルーマウンテン",
|
38
|
+
"extra"=>{"excerpt"=>"卓越した香気を持ち、調和の取れた味わい、軽い口当りと滑らかな咽越しが特徴。"}},
|
39
|
+
{"review"=>true,
|
40
|
+
"slug"=>"kona",
|
41
|
+
"title"=>"コナ",
|
42
|
+
"extra"=>{"excerpt"=>"非常に強い酸味とコク・風味を持つ。"}},
|
43
|
+
{"review"=>true,
|
44
|
+
"slug"=>"kilimanjaro",
|
45
|
+
"title"=>"キリマンジャロ",
|
46
|
+
"extra"=>{"excerpt"=>"タンザニア産のコーヒーの日本での呼称。"}}]}]
|
47
|
+
)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '#find_category' do
|
52
|
+
subject do
|
53
|
+
magazine_rack.find_category(category_slug).try(:to_hash)
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'when exist category' do
|
57
|
+
let(:category_slug) do
|
58
|
+
'drip'
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should return category' do
|
62
|
+
expect(subject).to eq(
|
63
|
+
{"category_slug"=>"drip",
|
64
|
+
"category_name"=>"ドリップ",
|
65
|
+
"extra"=>{"label_color"=>"orange"},
|
66
|
+
"articles"=>
|
67
|
+
[{"review"=>false,
|
68
|
+
"slug"=>"water",
|
69
|
+
"title"=>"ウォータードリップ",
|
70
|
+
"extra"=>{"excerpt"=>"専用の機材を用い水でコーヒーを抽出する方法。"}},
|
71
|
+
{"review"=>false,
|
72
|
+
"slug"=>"paper",
|
73
|
+
"title"=>"ペーパードリップ",
|
74
|
+
"extra"=>{"excerpt"=>"日本で最も普及していると思われる淹れ方。"}},
|
75
|
+
{"review"=>false,
|
76
|
+
"slug"=>"nel",
|
77
|
+
"title"=>"ネルドリップ",
|
78
|
+
"extra"=>{"excerpt"=>"フィルタとして布(綿フランネル)を使用する抽出法。"}}]}
|
79
|
+
)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
context 'when not exist category' do
|
84
|
+
let(:category_slug) do
|
85
|
+
'cup'
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'should return nil' do
|
89
|
+
expect(subject).to eq(nil)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#find_article' do
|
95
|
+
subject do
|
96
|
+
magazine_rack.find_article('drip', article_slug).try(:to_hash)
|
97
|
+
end
|
98
|
+
|
99
|
+
context 'when exist article' do
|
100
|
+
let(:article_slug) do
|
101
|
+
'water'
|
102
|
+
end
|
103
|
+
|
104
|
+
it 'should return article' do
|
105
|
+
expect(subject).to eq(
|
106
|
+
{"review"=>false,
|
107
|
+
"slug"=>"water",
|
108
|
+
"title"=>"ウォータードリップ",
|
109
|
+
"extra"=>{"excerpt"=>"専用の機材を用い水でコーヒーを抽出する方法。"}}
|
110
|
+
)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
context 'when not exist article' do
|
115
|
+
let(:article_slug) do
|
116
|
+
'foo'
|
117
|
+
end
|
118
|
+
|
119
|
+
it 'should return nil' do
|
120
|
+
expect(subject).to eq(nil)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
describe '#all_articles_with_category' do
|
126
|
+
it 'return assigned (article => category) hash' do
|
127
|
+
expect(magazine_rack.all_articles_with_category.to_hash).to eq(
|
128
|
+
{{"review"=>false,
|
129
|
+
"slug"=>"water",
|
130
|
+
"title"=>"ウォータードリップ",
|
131
|
+
"extra"=>{"excerpt"=>"専用の機材を用い水でコーヒーを抽出する方法。"}}=>
|
132
|
+
{"category_slug"=>"drip",
|
133
|
+
"category_name"=>"ドリップ",
|
134
|
+
"extra"=>{"label_color"=>"orange"}},
|
135
|
+
{"review"=>false,
|
136
|
+
"slug"=>"paper",
|
137
|
+
"title"=>"ペーパードリップ",
|
138
|
+
"extra"=>{"excerpt"=>"日本で最も普及していると思われる淹れ方。"}}=>
|
139
|
+
{"category_slug"=>"drip",
|
140
|
+
"category_name"=>"ドリップ",
|
141
|
+
"extra"=>{"label_color"=>"orange"}},
|
142
|
+
{"review"=>false,
|
143
|
+
"slug"=>"nel",
|
144
|
+
"title"=>"ネルドリップ",
|
145
|
+
"extra"=>{"excerpt"=>"フィルタとして布(綿フランネル)を使用する抽出法。"}}=>
|
146
|
+
{"category_slug"=>"drip",
|
147
|
+
"category_name"=>"ドリップ",
|
148
|
+
"extra"=>{"label_color"=>"orange"}},
|
149
|
+
{"review"=>true,
|
150
|
+
"slug"=>"blue-mountain",
|
151
|
+
"title"=>"ブルーマウンテン",
|
152
|
+
"extra"=>{"excerpt"=>"卓越した香気を持ち、調和の取れた味わい、軽い口当りと滑らかな咽越しが特徴。"}}=>
|
153
|
+
{"category_slug"=>"beans",
|
154
|
+
"category_name"=>"コーヒー豆",
|
155
|
+
"extra"=>{"label_color"=>"green"}},
|
156
|
+
{"review"=>true,
|
157
|
+
"slug"=>"kona",
|
158
|
+
"title"=>"コナ",
|
159
|
+
"extra"=>{"excerpt"=>"非常に強い酸味とコク・風味を持つ。"}}=>
|
160
|
+
{"category_slug"=>"beans",
|
161
|
+
"category_name"=>"コーヒー豆",
|
162
|
+
"extra"=>{"label_color"=>"green"}},
|
163
|
+
{"review"=>true,
|
164
|
+
"slug"=>"kilimanjaro",
|
165
|
+
"title"=>"キリマンジャロ",
|
166
|
+
"extra"=>{"excerpt"=>"タンザニア産のコーヒーの日本での呼称。"}}=>
|
167
|
+
{"category_slug"=>"beans",
|
168
|
+
"category_name"=>"コーヒー豆",
|
169
|
+
"extra"=>{"label_color"=>"green"}}}
|
170
|
+
)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
@@ -0,0 +1,173 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe Magazine::Rack do
|
4
|
+
let!(:magazine_rack) do
|
5
|
+
Magazine::Rack.new
|
6
|
+
end
|
7
|
+
|
8
|
+
describe '#initialize' do
|
9
|
+
subject do
|
10
|
+
magazine_rack.data.map(&:to_hash)
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should load config yml' do
|
14
|
+
expect(subject).to eq(
|
15
|
+
[{"category_slug"=>"drip",
|
16
|
+
"category_name"=>"ドリップ",
|
17
|
+
"extra"=>{"label_color"=>"orange"},
|
18
|
+
"articles"=>
|
19
|
+
[{"review"=>false,
|
20
|
+
"slug"=>"water",
|
21
|
+
"title"=>"ウォータードリップ",
|
22
|
+
"extra"=>{"excerpt"=>"専用の機材を用い水でコーヒーを抽出する方法。"}},
|
23
|
+
{"review"=>false,
|
24
|
+
"slug"=>"paper",
|
25
|
+
"title"=>"ペーパードリップ",
|
26
|
+
"extra"=>{"excerpt"=>"日本で最も普及していると思われる淹れ方。"}},
|
27
|
+
{"review"=>false,
|
28
|
+
"slug"=>"nel",
|
29
|
+
"title"=>"ネルドリップ",
|
30
|
+
"extra"=>{"excerpt"=>"フィルタとして布(綿フランネル)を使用する抽出法。"}}]},
|
31
|
+
{"category_slug"=>"beans",
|
32
|
+
"category_name"=>"コーヒー豆",
|
33
|
+
"extra"=>{"label_color"=>"green"},
|
34
|
+
"articles"=>
|
35
|
+
[{"review"=>true,
|
36
|
+
"slug"=>"blue-mountain",
|
37
|
+
"title"=>"ブルーマウンテン",
|
38
|
+
"extra"=>{"excerpt"=>"卓越した香気を持ち、調和の取れた味わい、軽い口当りと滑らかな咽越しが特徴。"}},
|
39
|
+
{"review"=>true,
|
40
|
+
"slug"=>"kona",
|
41
|
+
"title"=>"コナ",
|
42
|
+
"extra"=>{"excerpt"=>"非常に強い酸味とコク・風味を持つ。"}},
|
43
|
+
{"review"=>true,
|
44
|
+
"slug"=>"kilimanjaro",
|
45
|
+
"title"=>"キリマンジャロ",
|
46
|
+
"extra"=>{"excerpt"=>"タンザニア産のコーヒーの日本での呼称。"}}]}]
|
47
|
+
)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '#find_category' do
|
52
|
+
subject do
|
53
|
+
magazine_rack.find_category(category_slug).try(:to_hash)
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'when exist category' do
|
57
|
+
let(:category_slug) do
|
58
|
+
'drip'
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should return category' do
|
62
|
+
expect(subject).to eq(
|
63
|
+
{"category_slug"=>"drip",
|
64
|
+
"category_name"=>"ドリップ",
|
65
|
+
"extra"=>{"label_color"=>"orange"},
|
66
|
+
"articles"=>
|
67
|
+
[{"review"=>false,
|
68
|
+
"slug"=>"water",
|
69
|
+
"title"=>"ウォータードリップ",
|
70
|
+
"extra"=>{"excerpt"=>"専用の機材を用い水でコーヒーを抽出する方法。"}},
|
71
|
+
{"review"=>false,
|
72
|
+
"slug"=>"paper",
|
73
|
+
"title"=>"ペーパードリップ",
|
74
|
+
"extra"=>{"excerpt"=>"日本で最も普及していると思われる淹れ方。"}},
|
75
|
+
{"review"=>false,
|
76
|
+
"slug"=>"nel",
|
77
|
+
"title"=>"ネルドリップ",
|
78
|
+
"extra"=>{"excerpt"=>"フィルタとして布(綿フランネル)を使用する抽出法。"}}]}
|
79
|
+
)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
context 'when not exist category' do
|
84
|
+
let(:category_slug) do
|
85
|
+
'cup'
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'should return nil' do
|
89
|
+
expect(subject).to eq(nil)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#find_article' do
|
95
|
+
subject do
|
96
|
+
magazine_rack.find_article('drip', article_slug).try(:to_hash)
|
97
|
+
end
|
98
|
+
|
99
|
+
context 'when exist article' do
|
100
|
+
let(:article_slug) do
|
101
|
+
'water'
|
102
|
+
end
|
103
|
+
|
104
|
+
it 'should return article' do
|
105
|
+
expect(subject).to eq(
|
106
|
+
{"review"=>false,
|
107
|
+
"slug"=>"water",
|
108
|
+
"title"=>"ウォータードリップ",
|
109
|
+
"extra"=>{"excerpt"=>"専用の機材を用い水でコーヒーを抽出する方法。"}}
|
110
|
+
)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
context 'when not exist article' do
|
115
|
+
let(:article_slug) do
|
116
|
+
'foo'
|
117
|
+
end
|
118
|
+
|
119
|
+
it 'should return nil' do
|
120
|
+
expect(subject).to eq(nil)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
describe '#all_articles_with_category' do
|
126
|
+
it 'return assigned article => category hash' do
|
127
|
+
expect(magazine_rack.all_articles_with_category.to_hash).to eq(
|
128
|
+
{{"review"=>false,
|
129
|
+
"slug"=>"water",
|
130
|
+
"title"=>"ウォータードリップ",
|
131
|
+
"extra"=>{"excerpt"=>"専用の機材を用い水でコーヒーを抽出する方法。"}}=>
|
132
|
+
{"category_slug"=>"drip",
|
133
|
+
"category_name"=>"ドリップ",
|
134
|
+
"extra"=>{"label_color"=>"orange"}},
|
135
|
+
{"review"=>false,
|
136
|
+
"slug"=>"paper",
|
137
|
+
"title"=>"ペーパードリップ",
|
138
|
+
"extra"=>{"excerpt"=>"日本で最も普及していると思われる淹れ方。"}}=>
|
139
|
+
{"category_slug"=>"drip",
|
140
|
+
"category_name"=>"ドリップ",
|
141
|
+
"extra"=>{"label_color"=>"orange"}},
|
142
|
+
{"review"=>false,
|
143
|
+
"slug"=>"nel",
|
144
|
+
"title"=>"ネルドリップ",
|
145
|
+
"extra"=>{"excerpt"=>"フィルタとして布(綿フランネル)を使用する抽出法。"}}=>
|
146
|
+
{"category_slug"=>"drip",
|
147
|
+
"category_name"=>"ドリップ",
|
148
|
+
"extra"=>{"label_color"=>"orange"}},
|
149
|
+
{"review"=>true,
|
150
|
+
"slug"=>"blue-mountain",
|
151
|
+
"title"=>"ブルーマウンテン",
|
152
|
+
"extra"=>{"excerpt"=>"卓越した香気を持ち、調和の取れた味わい、軽い口当りと滑らかな咽越しが特徴。"}}=>
|
153
|
+
{"category_slug"=>"beans",
|
154
|
+
"category_name"=>"コーヒー豆",
|
155
|
+
"extra"=>{"label_color"=>"green"}},
|
156
|
+
{"review"=>true,
|
157
|
+
"slug"=>"kona",
|
158
|
+
"title"=>"コナ",
|
159
|
+
"extra"=>{"excerpt"=>"非常に強い酸味とコク・風味を持つ。"}}=>
|
160
|
+
{"category_slug"=>"beans",
|
161
|
+
"category_name"=>"コーヒー豆",
|
162
|
+
"extra"=>{"label_color"=>"green"}},
|
163
|
+
{"review"=>true,
|
164
|
+
"slug"=>"kilimanjaro",
|
165
|
+
"title"=>"キリマンジャロ",
|
166
|
+
"extra"=>{"excerpt"=>"タンザニア産のコーヒーの日本での呼称。"}}=>
|
167
|
+
{"category_slug"=>"beans",
|
168
|
+
"category_name"=>"コーヒー豆",
|
169
|
+
"extra"=>{"label_color"=>"green"}}}
|
170
|
+
)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require 'spec_helper'
|
4
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
5
|
+
require 'rspec/rails'
|
6
|
+
require 'capybara/rails'
|
7
|
+
require 'capybara/rspec'
|
8
|
+
require 'tapp'
|
9
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
10
|
+
|
11
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
12
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
13
|
+
# run as spec files by default. This means that files in spec/support that end
|
14
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
15
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
16
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
17
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
18
|
+
#
|
19
|
+
# The following line is provided for convenience purposes. It has the downside
|
20
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
21
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
22
|
+
# require only the support files necessary.
|
23
|
+
#
|
24
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
25
|
+
|
26
|
+
# Checks for pending migrations before tests are run.
|
27
|
+
# If you are not using ActiveRecord, you can remove this line.
|
28
|
+
ActiveRecord::Migration.maintain_test_schema!
|
29
|
+
|
30
|
+
RSpec.configure do |config|
|
31
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
32
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
33
|
+
config.use_transactional_fixtures = false
|
34
|
+
config.infer_spec_type_from_file_location!
|
35
|
+
|
36
|
+
Capybara.reset_sessions!
|
37
|
+
Capybara.use_default_driver
|
38
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require 'spec_helper'
|
4
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
5
|
+
require 'rspec/rails'
|
6
|
+
require 'capybara/rails'
|
7
|
+
require 'capybara/rspec'
|
8
|
+
require 'tapp'
|
9
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
10
|
+
|
11
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
12
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
13
|
+
# run as spec files by default. This means that files in spec/support that end
|
14
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
15
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
16
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
17
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
18
|
+
#
|
19
|
+
# The following line is provided for convenience purposes. It has the downside
|
20
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
21
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
22
|
+
# require only the support files necessary.
|
23
|
+
#
|
24
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
25
|
+
|
26
|
+
# Checks for pending migrations before tests are run.
|
27
|
+
# If you are not using ActiveRecord, you can remove this line.
|
28
|
+
ActiveRecord::Migration.maintain_test_schema!
|
29
|
+
|
30
|
+
RSpec.configure do |config|
|
31
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
32
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
33
|
+
config.use_transactional_fixtures = false
|
34
|
+
config.infer_spec_type_from_file_location!
|
35
|
+
|
36
|
+
Capybara.app = Rails.application
|
37
|
+
Capybara.reset_sessions!
|
38
|
+
Capybara.use_default_driver
|
39
|
+
end
|