Last active
October 30, 2017 20:08
-
-
Save thisismydesign/87e0b42bbab175445da56b34d58ddfcf to your computer and use it in GitHub Desktop.
Using rspec-rails in non-rails projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::ConnectionNotEstablished: No connection pool with 'primary' found. | |
-e:1:in `load' | |
-e:1:in `<main>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An error occurred while loading ./spec/project/project_spec.rb. | |
Failure/Error: require 'rspec/rails' | |
NameError: | |
uninitialized constant ActionView::Template::Handlers::ERB::ENCODING_FLAG | |
Did you mean? Encoding | |
# ./spec/spec_helper.rb:9:in `require' | |
# ./spec/spec_helper.rb:9:in `<top (required)>' | |
# ./spec/project/project_spec.rb:1:in `require' | |
# ./spec/project/project_spec.rb:1:in `<top (required)>' | |
# -e:1:in `load' | |
# -e:1:in `<main>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expect { | |
Job.perform_later | |
}.to have_fgkjbfvghfjk(Job) | |
# => You must pass an argument rather than a block to use the provided matcher (have fgkjbfvghfjk Job), or the matcher must implement `supports_block_expectations?`. | |
expect { | |
Job.perform_later | |
}.to fgkjbfvghfjk(Job) | |
# => NoMethodError: undefined method `fgkjbfvghfjk' for #<RSpec::ExampleGroups::Something:0x007f827dab4170> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expect(Job).to have_been_enqueued | |
# => expected Job to respond to `has_been_enqueued?` | |
expect { | |
Job.perform_later | |
}.to have_enqueued_job(Job) | |
# => You must pass an argument rather than a block to use the provided matcher (have enqueued job Job), or the matcher must implement `supports_block_expectations?`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "action_controller/railtie" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment