How to create a minitest fixture for a non database model?

1
Testing
Hi! Is there a way to create a fixture for a model that is not in the database? I built my app a few years back following a guide in which the Plans were loaded from a YML file and instantiated as...
Simon Moro replied
Solved

Running only a part of a huge (2000+) specs suite

2
Testing
I'm working on a Rails app with 2000+ feature specs. That's a lot and takes 45+ min to run (8min when running in parallel containers). What are the strategies to speed this up? Is there a smart wa...
karatepicke replied

Simple Test with empty rails fails

0
Testing
Hi everyone, I'm currently trying to create a template for internal Rails development and I just tried the newest Rails 6.0.3.1 and it fails with a simple test: ``` /tmp $ mkdir app-test /tmp $ c...
Andreas Steinel posted

guard-minitest runs ALL tests not just the ones for the target file changed

1
Testing
I stripped my Guardfile down to this. If I edit a controller guard starts ALL tests. `guard :minitest, all_on_start: false, all_after_pass: false, spring: true do watch(%r{^app/controllers/(.+)_...
Solved

rails test attempts to create multiple test databases and fails because it cannot connect

1
Testing
rails 6.0 minitest 5.1 mysql2 gem I'm having (what seems to me) a rather peculiar problem running **rails test** right from the get-go. All the correct databases exist, the rails user has what sh...
Ian Burry replied
Solved

Testing and Session Variables

1
Testing
In my Rails 5 app I am using Pundit for authorization with a custom context. I have a multi-tenant application and I have an `Enrollment` model that joins my `User` and `Tenant` model. This was a...
Dan Tappin replied
Solved

Accounts middleware and integration tests?

0
Testing
Hi folks — I'm a big fan of the Accounts Middleware pattern introduced about a year ago in this tutorial: https://gorails.com/episodes/rails-active-support-current-attributes Super powerful. Appl...
Dan Charlesworth posted

Access the request object in a helper in a helper test (minitest)

2
Testing
Using Rails 6 and minitest, I am testing a helper method which generates a JWT token to make a request to an external service. Inside the JWT's payload hash, I need the pass the source url. Ideally...
Wout replied
Solved

Issues running System Tests due to missing font?

0
Testing
I have written two system tests for my current application and I have now hit a road block. ``` test "visiting the timesheet index without signing in" do visit timesheets_path assert_te...
Stephen Sizer posted

i18n + Minitest

1
Testing
I have a complete rails application with Tests (Minitest 100% coverage)I'm trying to use i18n in this app, as told  in http://guides.rubyonrails.org/i18n.html , taking the locale from the url ...
Lluis Toyos replied

I have an error of the following form and I am unable to point out the error.

3
Testing
 Unable to autoload constant CONSTANT_NAME, expected TESTING_FILE_PATH to define it
John Meehan replied

Check if class was instantiated and instance method was called

1
Testing
Hey guys! I'd like to figure out a way to test piece of code that suppose to create an instance of particular class. Here is an example: ``` ruby class Subject def call ... end end class ...
Alex Musayev replied
Solved

Issue with Capybara file uploads testing

0
Testing
Hello! I have issue with uploading files by Capybara Rspec Selenium. Here is more details about it: https://stackoverflow.com/questions/48499129/capybara-upload-images-issue Please help!
Anton Storchak posted

Struggling with an association test

1
Testing
I have a project that has a User, a Building, and a Role There is a building_roles table that is user_id, building_id, and role_id Then I have a has_many :users through building_roles There is a va...
John Sanchez replied

Capybara is sending HTML format on request instead of JS

0
Testing
The feature works perfectly on the browser, however on the tests when Capybara clicks the submit button the request is processed as an HTML: `Processing by SearchController#index as HTML` Instead ...
Zubin Teherani posted

Can someone help explain how to use test_double to mock a gem class in my app?

7
Testing
Hello, My app uses a gem that goes out to network devices. I want to write some specs that test my classes without going out to the network devices via the gem. I want to use test_double or some...
Bill Snapper replied

Testing your markdown

3
Testing
I see your markdown tables aren't being rendered as tables. I have the same problem :( Any idea how we get this fixed? | Tables | Are | Cool | | ------------- |:-------------:| -...
Chris Oliver replied
Solved

Testing Turbolinks 3 partial replacement

1
Testing
Hey Chris (and everyone else) - Have you played around much with Turbolinks 3 partial replacement? (Chris, I wathed your livecoding segment; was great, thanks.) I'm using it with Rails 4.2.5, and...
Chris Oliver replied

Want to stay up-to-date with Ruby on Rails?

Join 89,735+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.