Skip to content

Commit 9338166

Browse files
committed
test: user spec added
1 parent a83ab42 commit 9338166

File tree

7 files changed

+22
-12
lines changed

7 files changed

+22
-12
lines changed

Gemfile.lock

+7-7
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ GEM
138138
rb-fsevent (0.10.3)
139139
rb-inotify (0.10.0)
140140
ffi (~> 1.0)
141-
rspec-core (3.0.4)
142-
rspec-support (~> 3.0.0)
143-
rspec-expectations (3.0.4)
141+
rspec-core (3.9.0)
142+
rspec-support (= 3.9.0)
143+
rspec-expectations (3.9.0)
144144
diff-lcs (>= 1.2.0, < 2.0)
145-
rspec-support (~> 3.0.0)
146-
rspec-mocks (3.0.4)
147-
rspec-support (~> 3.0.0)
145+
rspec-support (= 3.9.0)
146+
rspec-mocks (3.9.0)
147+
rspec-support (= 3.9.0)
148148
rspec-rails (3.0.2)
149149
actionpack (>= 3.0)
150150
activesupport (>= 3.0)
@@ -153,7 +153,7 @@ GEM
153153
rspec-expectations (~> 3.0.0)
154154
rspec-mocks (~> 3.0.0)
155155
rspec-support (~> 3.0.0)
156-
rspec-support (3.0.4)
156+
rspec-support (3.9.0)
157157
ruby_dep (1.5.0)
158158
sass (3.7.4)
159159
sass-listen (~> 4.0.0)

app/views/users/new.html.erb

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
<%=
3232
f.text_field :last_name,
3333
class: "form-control",
34-
placeholder: "Your last name",
35-
autofocus: true
34+
placeholder: "Your last name"
3635
%>
3736
</div>
3837
</div>
File renamed without changes.

spec/factories/users.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FactoryBot.define do
2+
factory :user do
3+
4+
end
5+
end

spec/models/user_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require 'rails_helper'
2+
3+
RSpec.describe User, :type => :model do
4+
5+
end

spec/rails_helper.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
RSpec.configure do |config|
2121
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
22-
config.fixture_path = "#{::Rails.root}/spec/fixtures"
22+
# config.fixture_path = "#{::Rails.root}/spec/fixtures"
2323

2424
# If you're not using ActiveRecord, or you'd prefer not to run each of your
2525
# examples within a transaction, remove the following line or assign false
2626
# instead of true.
27-
config.use_transactional_fixtures = true
27+
# config.use_transactional_fixtures = false
2828

2929
# RSpec Rails can automatically mix in different behaviours to your tests
3030
# based on their file location, for example enabling you to call `get` and
@@ -40,4 +40,5 @@
4040
# The different available types are documented in the features, such as in
4141
# https://relishapp.com/rspec/rspec-rails/docs
4242
config.infer_spec_type_from_file_location!
43+
config.include FactoryBot::Syntax::Methods
4344
end

spec/spec_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@
7575
mocks.verify_partial_doubles = true
7676
end
7777
=end
78-
config.include FactoryBot::Syntax::Methods
78+
7979
end

0 commit comments

Comments
 (0)