質問編集履歴
6
rails g rspec:install実行時ログ
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -61,4 +61,19 @@
|
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
### 試したこと
|
|
64
|
-
rails g rspec:install
|
|
64
|
+
rails g rspec:install
|
|
65
|
+
|
|
66
|
+
実行時すでにファイルがあるのでコンフリクトが発生する。
|
|
67
|
+
```
|
|
68
|
+
Running via Spring preloader in process 2829
|
|
69
|
+
conflict .rspec
|
|
70
|
+
Overwrite /Users/user/Desktop/wanokokoro/.rspec? (enter "h" for help) [Ynaqdh] n
|
|
71
|
+
skip .rspec
|
|
72
|
+
exist spec
|
|
73
|
+
conflict spec/spec_helper.rb
|
|
74
|
+
Overwrite /Users/user/Desktop/wanokokoro/spec/spec_helper.rb? (enter "h" for help) [Ynaqdh] n
|
|
75
|
+
skip spec/spec_helper.rb
|
|
76
|
+
conflict spec/rails_helper.rb
|
|
77
|
+
Overwrite /Users/user/Desktop/wanokokoro/spec/rails_helper.rb? (enter "h" for help) [Ynaqdh] n
|
|
78
|
+
skip spec/rails_helper.rb
|
|
79
|
+
```
|
5
初心者マークの設定
title
CHANGED
|
File without changes
|
body
CHANGED
|
File without changes
|
4
Gemfileの置き換え、エラーメッセージの置き換え
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
rails5でRspecを動かしたいのですが、
|
|
3
3
|
エラーが出ます。
|
|
4
4
|
|
|
5
|
+
|
|
5
|
-
|
|
6
|
+
```Gemfile
|
|
6
|
-
...
|
|
7
7
|
group :development, :test do
|
|
8
8
|
51 # Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
|
9
9
|
52 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
|
|
@@ -24,13 +24,12 @@
|
|
|
24
24
|
76 # Easy installation and use of chromedriver to run system tests with Chrom e
|
|
25
25
|
77 gem 'chromedriver-helper'
|
|
26
26
|
78 end
|
|
27
|
-
|
|
27
|
+
```
|
|
28
|
-
|
|
29
28
|
### 発生している問題・エラーメッセージ
|
|
30
29
|
bundle exec rspec ./ 実行時
|
|
30
|
+
```
|
|
31
31
|
An error occurred while loading ./sessions_controller_spec.rb.
|
|
32
32
|
Failure/Error: require 'rails_helper'
|
|
33
|
-
```
|
|
34
33
|
LoadError:
|
|
35
34
|
cannot load such file -- rails_helper
|
|
36
35
|
./sessions_controller_spec.rb:1:in `require'
|
3
Gemfileの置き換え
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
エラーが出ます。
|
|
4
4
|
|
|
5
5
|
#Gemfile
|
|
6
|
+
...
|
|
6
7
|
group :development, :test do
|
|
7
8
|
51 # Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
|
8
9
|
52 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
|
|
@@ -23,8 +24,8 @@
|
|
|
23
24
|
76 # Easy installation and use of chromedriver to run system tests with Chrom e
|
|
24
25
|
77 gem 'chromedriver-helper'
|
|
25
26
|
78 end
|
|
27
|
+
...
|
|
26
28
|
|
|
27
|
-
|
|
28
29
|
### 発生している問題・エラーメッセージ
|
|
29
30
|
bundle exec rspec ./ 実行時
|
|
30
31
|
An error occurred while loading ./sessions_controller_spec.rb.
|
2
ソースコード追加、エラーメッセージの置き換え
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -30,17 +30,34 @@
|
|
|
30
30
|
An error occurred while loading ./sessions_controller_spec.rb.
|
|
31
31
|
Failure/Error: require 'rails_helper'
|
|
32
32
|
```
|
|
33
|
-
エラーメッセージ
|
|
34
|
-
```
|
|
35
33
|
LoadError:
|
|
36
34
|
cannot load such file -- rails_helper
|
|
37
35
|
./sessions_controller_spec.rb:1:in `require'
|
|
38
36
|
./sessions_controller_spec.rb:1:in `<top (required)>'
|
|
37
|
+
```
|
|
39
38
|
|
|
39
|
+
|
|
40
40
|
### 該当のソースコード
|
|
41
41
|
|
|
42
|
-
```
|
|
42
|
+
```Ruby
|
|
43
|
+
1 require 'rails_helper'
|
|
44
|
+
2
|
|
45
|
+
3 RSpec.describe 'SessionsController', type: :controller do
|
|
46
|
+
4
|
|
47
|
+
5 before :each do
|
|
48
|
+
6 @user = build(:user)
|
|
49
|
+
7 end
|
|
50
|
+
8
|
|
51
|
+
9 after :each do
|
|
52
|
+
10 @user = nil
|
|
53
|
+
11 end
|
|
54
|
+
12
|
|
55
|
+
13 it 'user name validation' do
|
|
56
|
+
14 expect(@user).to be_valid
|
|
43
|
-
|
|
57
|
+
15 end
|
|
58
|
+
16
|
|
59
|
+
17 end
|
|
60
|
+
|
|
44
61
|
```
|
|
45
62
|
|
|
46
63
|
### 試したこと
|
1
タイトル修正
title
CHANGED
|
@@ -1,1 +1,1 @@
|
|
|
1
|
-
|
|
1
|
+
rails5でRspec実行時にエラーが出る
|
body
CHANGED
|
File without changes
|