質問編集履歴
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -82,4 +82,76 @@
|
|
82
82
|
```
|
83
83
|
参考にした記事:https://teratail.com/questions/343233
|
84
84
|
|
85
|
+
また、RSpecのバージョンは以下のようになっております。(バージョンアップする前は、rspec-rails (4.0.0)でした。)
|
86
|
+
```ここに言語を入力
|
87
|
+
Gemfile.lock
|
88
|
+
|
89
|
+
rspec-core (3.11.0)
|
90
|
+
rspec-support (~> 3.11.0)
|
91
|
+
rspec-expectations (3.11.0)
|
92
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
93
|
+
rspec-support (~> 3.11.0)
|
94
|
+
rspec-mocks (3.11.1)
|
95
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
96
|
+
rspec-support (~> 3.11.0)
|
97
|
+
rspec-rails (5.1.2)
|
98
|
+
actionpack (>= 5.2)
|
99
|
+
activesupport (>= 5.2)
|
100
|
+
railties (>= 5.2)
|
101
|
+
rspec-core (~> 3.10)
|
102
|
+
rspec-expectations (~> 3.10)
|
103
|
+
rspec-mocks (~> 3.10)
|
104
|
+
rspec-support (~> 3.10)
|
105
|
+
rspec-support (3.11.0)
|
106
|
+
```
|
107
|
+
|
108
|
+
エラーが発生しているファイルは以下となります。
|
109
|
+
```ここに言語を入力
|
110
|
+
Rails_helper.rb
|
111
|
+
|
112
|
+
ENV['RAILS_ENV'] ||= 'test'
|
113
|
+
require File.expand_path('../../config/environment', __FILE__)
|
114
|
+
|
115
|
+
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
116
|
+
require 'spec_helper'
|
117
|
+
require 'rspec/rails'
|
118
|
+
require 'shoulda/matchers'
|
119
|
+
|
120
|
+
Shoulda::Matchers.configure do |config|
|
121
|
+
config.integrate do |with|
|
122
|
+
with.test_framework :rspec
|
123
|
+
with.library :active_record
|
124
|
+
with.library :active_model
|
125
|
+
with.library :action_controller
|
126
|
+
with.library :rails
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# Coverage
|
131
|
+
require 'simplecov'
|
132
|
+
SimpleCov.start 'rails'
|
133
|
+
|
134
|
+
ActiveRecord::Migration.maintain_test_schema!
|
135
|
+
|
136
|
+
RSpec.configure do |config|
|
137
|
+
|
138
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
139
|
+
|
140
|
+
config.use_transactional_fixtures = true
|
141
|
+
|
142
|
+
config.infer_spec_type_from_file_location!
|
143
|
+
|
144
|
+
config.filter_rails_from_backtrace!
|
145
|
+
|
146
|
+
[:controller, :view, :request].each do |type|
|
147
|
+
config.include ::Rails::Controller::Testing::TestProcess, type: type
|
148
|
+
config.include ::Rails::Controller::Testing::TemplateAssertions, type: type
|
149
|
+
config.include ::Rails::Controller::Testing::Integration, type: type
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
154
|
+
|
155
|
+
```
|
156
|
+
|
85
|
-
|
157
|
+
お手数をお掛けいたしますが、よろしくお願いいたします。
|