質問編集履歴
6
rails g rspec:install実行時ログ
test
CHANGED
File without changes
|
test
CHANGED
@@ -125,3 +125,33 @@
|
|
125
125
|
### 試したこと
|
126
126
|
|
127
127
|
rails g rspec:install
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
実行時すでにファイルがあるのでコンフリクトが発生する。
|
132
|
+
|
133
|
+
```
|
134
|
+
|
135
|
+
Running via Spring preloader in process 2829
|
136
|
+
|
137
|
+
conflict .rspec
|
138
|
+
|
139
|
+
Overwrite /Users/user/Desktop/wanokokoro/.rspec? (enter "h" for help) [Ynaqdh] n
|
140
|
+
|
141
|
+
skip .rspec
|
142
|
+
|
143
|
+
exist spec
|
144
|
+
|
145
|
+
conflict spec/spec_helper.rb
|
146
|
+
|
147
|
+
Overwrite /Users/user/Desktop/wanokokoro/spec/spec_helper.rb? (enter "h" for help) [Ynaqdh] n
|
148
|
+
|
149
|
+
skip spec/spec_helper.rb
|
150
|
+
|
151
|
+
conflict spec/rails_helper.rb
|
152
|
+
|
153
|
+
Overwrite /Users/user/Desktop/wanokokoro/spec/rails_helper.rb? (enter "h" for help) [Ynaqdh] n
|
154
|
+
|
155
|
+
skip spec/rails_helper.rb
|
156
|
+
|
157
|
+
```
|
5
初心者マークの設定
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
4
Gemfileの置き換え、エラーメッセージの置き換え
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
#Gemfile
|
10
9
|
|
10
|
+
|
11
|
-
|
11
|
+
```Gemfile
|
12
12
|
|
13
13
|
group :development, :test do
|
14
14
|
|
@@ -50,19 +50,17 @@
|
|
50
50
|
|
51
51
|
78 end
|
52
52
|
|
53
|
-
|
53
|
+
```
|
54
|
-
|
55
|
-
|
56
54
|
|
57
55
|
### 発生している問題・エラーメッセージ
|
58
56
|
|
59
57
|
bundle exec rspec ./ 実行時
|
60
58
|
|
59
|
+
```
|
60
|
+
|
61
61
|
An error occurred while loading ./sessions_controller_spec.rb.
|
62
62
|
|
63
63
|
Failure/Error: require 'rails_helper'
|
64
|
-
|
65
|
-
```
|
66
64
|
|
67
65
|
LoadError:
|
68
66
|
|
3
Gemfileの置き換え
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
#Gemfile
|
10
|
+
|
11
|
+
...
|
10
12
|
|
11
13
|
group :development, :test do
|
12
14
|
|
@@ -48,7 +50,7 @@
|
|
48
50
|
|
49
51
|
78 end
|
50
52
|
|
51
|
-
|
53
|
+
...
|
52
54
|
|
53
55
|
|
54
56
|
|
2
ソースコード追加、エラーメッセージの置き換え
test
CHANGED
File without changes
|
test
CHANGED
@@ -62,10 +62,6 @@
|
|
62
62
|
|
63
63
|
```
|
64
64
|
|
65
|
-
エラーメッセージ
|
66
|
-
|
67
|
-
```
|
68
|
-
|
69
65
|
LoadError:
|
70
66
|
|
71
67
|
cannot load such file -- rails_helper
|
@@ -74,15 +70,53 @@
|
|
74
70
|
|
75
71
|
./sessions_controller_spec.rb:1:in `<top (required)>'
|
76
72
|
|
73
|
+
```
|
74
|
+
|
75
|
+
|
76
|
+
|
77
77
|
|
78
78
|
|
79
79
|
### 該当のソースコード
|
80
80
|
|
81
81
|
|
82
82
|
|
83
|
-
```
|
83
|
+
```Ruby
|
84
84
|
|
85
|
+
1 require 'rails_helper'
|
86
|
+
|
87
|
+
2
|
88
|
+
|
89
|
+
3 RSpec.describe 'SessionsController', type: :controller do
|
90
|
+
|
91
|
+
4
|
92
|
+
|
93
|
+
5 before :each do
|
94
|
+
|
95
|
+
6 @user = build(:user)
|
96
|
+
|
97
|
+
7 end
|
98
|
+
|
99
|
+
8
|
100
|
+
|
101
|
+
9 after :each do
|
102
|
+
|
103
|
+
10 @user = nil
|
104
|
+
|
105
|
+
11 end
|
106
|
+
|
107
|
+
12
|
108
|
+
|
109
|
+
13 it 'user name validation' do
|
110
|
+
|
111
|
+
14 expect(@user).to be_valid
|
112
|
+
|
85
|
-
|
113
|
+
15 end
|
114
|
+
|
115
|
+
16
|
116
|
+
|
117
|
+
17 end
|
118
|
+
|
119
|
+
|
86
120
|
|
87
121
|
```
|
88
122
|
|
1
タイトル修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
rails5でRspec実行時にエラーが出る
|
test
CHANGED
File without changes
|