Comments (17)
I just added some tests ed35b2d to make sure assert_routing worked and so far I do not have any errors. Can you QA this and investigate your issue more?
All my tests passed locally, but here is the TravisCI build which is running now for this latest.
from minitest-spec-rails.
I'm trying to use the minitest-rails
gem instead now, and if that works I'll try and compare what I did. I don't see a difference between your tested implementation and the one I had, but I'm guessing there's a more subtile difference somewhere.
from minitest-spec-rails.
What I noted most though, is that the error sais recognize_path
is undefined for nil:NilClass. I'm, wondering how my test could be nil:NilClass.
from minitest-spec-rails.
I don't see a difference between your tested implementation and the one
There are differences, currently. But our aim is the same. This project is tested from Rails 2.3 to 4.0 with support for both Ruby 1.8 to 2.0.
the error sais recognize_path is undefined for nil:NilClass.
I'm, wondering how my test could be nil:NilClass.
Your nil error is from this line. For some reason @routes
is nil in your test. I would like to know why
from minitest-spec-rails.
Hm, I'm was calling the test like this: ruby -Itest test/routes/*_test.rb
, but that shouldn't change a thing, since the spec helper should set up the environment, right? Is the minitest-spec-rails
allowed to be in the test
group in the gemfile? minitest-rails
is not, if you place it in the test
group the rake file is unavailable, maybe that could cause the troubles?
from minitest-spec-rails.
Hm, I'm was calling the test like this: ruby -Itest test/routes/*_test.rb, but that shouldn't
change a thing, since the spec helper should set up the environment, right?
Correct, technically the test/test_helper.rb
sets up the entire environment. Why did you say spec helper, are you working with a custom non-rails directory structure?
Is the minitest-spec-rails allowed to be in the test group in the gemfile?
That is where it should be. I am not sure why it would be any where else.
minitest-rails is not, if you place it in the test group the rake file is unavailable
So minitest-rails has a custom rake task? If so, this is one of the things I do not like about that project. It started off as something similar to rspec-rails, with generators, etc. The minitest-spec-rails is completely different in the approach, it does not use generators, requires no special directory structure or anything outside the normal rails environment. This includes rake tasks, etc.
from minitest-spec-rails.
Neh I just said that because I come from Rspec;) I tend to agree with your point on the minitest-spec-rails
being better. I feel I should try to figure out what I did wrong with my implementation before I switched to minitest-rails
too. I've created a few tests for the latter now, so I'll give minitest-spec-rails
one more go before I park it.
from minitest-spec-rails.
No luck. What seems interesting to me if that running rake test
does not find any of the tests I've written. If I understand correctly that should run all of my tests right?
from minitest-spec-rails.
Lemme help too... I'm gonna add the same test here https://github.com/metaskills/holy_grail_harness as an integration test in a base app. Will let you know.
from minitest-spec-rails.
Hold on, funny how ones own remarks sometimes point at the actual problem (as well as freaking annoying). Coming from rspec I'm used to stuffing my tests where-ever I want to, but integration tests are not supposed to go into a routing
dir, they are supposed to go into integration
. Placing it there fixed the entire thing...
from minitest-spec-rails.
Awesome! 🎆 Thanks for following up! Closing the ticket. Cheers!
from minitest-spec-rails.
Thanks for helping out!
from minitest-spec-rails.
I know it's super late to the party, but I came across this thread trying to resolve undefined method assert_routing
. I wanted to point out for anyone trying to solve that problem who ended up here that you can put the test in any subset of dirs and use the MiniTest DSL.
major caveat: you must have either "Acceptance Test" or "Integration Test" at the end of the describe block string. Convention over configuration, ftw.
Example:
# /test/routing/some_test.rb
require 'test_helper'
describe "My Routing Integration Test" do
describe "/some-route" do
it "returns some_controller#some_action" do
assert_routing '/some-route', controller: 'some_controller', action: 'some_action'
end
end
end
I'm using minitest-rails (2.1.1)
from minitest-spec-rails.
Thanks, but this gem and mintest-rails are different entities and take drastically different approaches to how we integrate MT and Rails.
from minitest-spec-rails.
@metaskills My apologies for the misplaced comment. I will delete, if you would like.
from minitest-spec-rails.
No apology needed. There is no bad blood between the projects. Just wanted to point out the difference in case anyone treaded here. FYI, I could have deleted too, but that's not my style. Rock on!
from minitest-spec-rails.
That's why I offered 😉 . Big hugs to all open source maintainers. Thank you for your continued contribution to us all.
from minitest-spec-rails.
Related Issues (20)
- Initialization autoloaded the constants ActionText::ContentHelper using Rails 6.0.3.1 HOT 1
- stack level too deep HOT 2
- Issue testing Helpers after upgrading to Rails 6.1
- Cheetsheet link dead HOT 2
- Deprecation warning when used with flipper/prawn-rails HOT 2
- Rspec-rails and Minitest-spec-rails HOT 3
- Cheat sheet missing? HOT 1
- Using string instead of constant for describe argument causes data leakage
- Interview partners for research about communication in GitHub projects wanted
- Use new Minitest constant over MiniTest HOT 1
- Breaks order setting for Rails and Minitest HOT 7
- rails 5 test outputs wrong location of test case HOT 17
- Shouldn't depend on rails gem HOT 3
- When test methods are mixed with describe blocks, they get run multiple times sometimes. HOT 3
- more information HOT 4
- Rails 3.2: empty test is ran after every rake command HOT 6
- Rails 5 support? HOT 1
- Pararallel testing HOT 9
- Rails 6 errors current_server': DRb::DRbServerNotFound (DRb::DRbConnError) HOT 6
- Unable to run tests locally
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minitest-spec-rails.