rspec tag

31 questions


1 answers
89 views
0
factorybot does not work

Currently using rspec to study test code.So I am using factory_bot, but I get an error in the build.KeyError: Factory not registered:Here is the error statement.https://masawada.hatenablog.jp/entry/20...


1 answers
91 views
0
I don't understand why I run expect before the code I want to test when I use the mock in RSpec.

I created the test code below, but if I put the code expect under get:index params, I get an error if there is no value.It's strange that other test codes (without a mock) had code that you wanted to ...


2 answers
103 views
0
rspec does not pass the test using create_list in factorybot

spec/factories/projects.rbI would like to set the user.rb to create 5 projects each time a user is created, but an error is printed and it does not work well.FactoryBot.definedo factory —Project do se...

2 years ago

1 answers
132 views
0
Rspec reports Rails environment is running in production mode!

We are currently creating a portfolio (Rails-api, React) and the deployment to production heroku has been completed.After running the previous Rspec and confirming that there was no problem, I was goi...

2 years ago

1 answers
113 views
0
Does the email address that you set up using Faker in RSpec exist?

Is the email address that I set using Faker in RSpec real?I don't have it yet, but when I started creating a feature that would send mail to users, I think it would be a problem if the email was unint...

2 years ago

1 answers
93 views
0
I want to increase the number of target data by one by sending POST in request spec, but I get Can't verify CSRF token authenticity.

Rails 7.0DockerI am currently studying Rspec in the Introduction to Rails Testing with Everyday Rails Rspec We are testing using requestspec to send Post to make sure DB has one more target data, but ...

2 years ago

1 answers
125 views
0
What is the difference between RSpec let and let!?

While I was studying, I found something I didn't understand.Why should I review the instance variableWhen I read the article above, it said this.Let is called at the required time, but before instance...

2 years ago

1 answers
83 views
0
I want to create a convenient method in rspec that creates a set of factorybot and make it common among files.

You want to create a set of 3 users and their associated data as follows:before do user1 = create(:user) create(:profile, user_id:user1.id) create(:image,user_id:user1.id) create(:birthday,user_id:use...

2 years ago

1 answers
85 views
0
I don't know how to test subdomains with docker-compose + Rails 5.1 + rspec + HeadlessChrome

environment:Rails: 5.1.5Ruby: 2.5.0capybara:2.18.0rspec-rails: 3.7.2selenium-webdriver: 3.10.0 I'm a beginner at Docker.We are currently creating a development environment with docker-compose as follo...


1 answers
87 views
0
When I press submit button in form in capybara, the data in the database disappears for some reason.

If you test it on your browser, it will succeed, but if you test it on capybara, it will fail.If you submit it on the edit screen as shown below, update it.def update # When the post button is pressed...

« - 2 - »

© 2024 OneMinuteCode. All rights reserved.