Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates default configuration to use requests specs #1091

Closed
wants to merge 1 commit into from

Conversation

dorianmariecom
Copy link
Contributor

We were trying out suspenders, e.g. suspenders projectname

Then did a scaffold rails g scaffold Book title

Then when running the specs (rspec) we got an error related to the views not rendering.

A good fix is to use requests specs instead of controller specs, they render the views so they test more code

Fixes #1090

Co-Authored-By: Dorian Marié dorian@dorianmarie.fr

@iftheshoefritz
Copy link
Contributor

Controller specs are out of fashion with Rails anyway, this change seems like a win to me.

Co-Authored-By: Dorian Marié <dorian@dorianmarie.fr>
@@ -3,7 +3,7 @@
module Suspenders
class TestingGenerator < Generators::Base
def add_testing_gems
gem "rspec-rails", "~> 3.6", group: %i[development test]
gem "rspec-rails", "~> 5.1", group: %i[development test]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might not have been necessary but it seems like a good idea to upgrade in any case.

Copy link
Contributor

@thiagoa thiagoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generally looking good, thank you for taking this on!

The tests are failing, and it looks like you've forgotten to change the generator template here:

generate.request_specs false

I suspect changing false to true will make it pass, is that correct?

After fixing the test failure and undoing the version bump, looks good to merge!

@@ -4,5 +4,5 @@ module Suspenders
.read("#{File.dirname(__FILE__)}/../../.ruby-version")
.strip
.freeze
VERSION = "1.55.1".freeze
VERSION = "1.55.2".freeze
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we undo this version bump? There are other unreleased changes in mainline and we may want to version them differently. Thank you!

@dorianmariecom
Copy link
Contributor Author

Note that I needed to run bin/webpack-dev-server with a .node-version of 16.15.0.

@dorianmariecom
Copy link
Contributor Author

This pull request is superseded by #1094 because I use my fork

@iftheshoefritz iftheshoefritz deleted the use-requests-specs branch May 9, 2022 13:15
@iftheshoefritz iftheshoefritz restored the use-requests-specs branch May 9, 2022 13:15
@iftheshoefritz iftheshoefritz deleted the use-requests-specs branch May 9, 2022 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After scaffolding a model, one of the generated tests fails
3 participants