Coder Social home page Coder Social logo

Comments (17)

metaskills avatar metaskills commented on August 20, 2024

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.

jasperkennis avatar jasperkennis commented on August 20, 2024

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.

jasperkennis avatar jasperkennis commented on August 20, 2024

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.

metaskills avatar metaskills commented on August 20, 2024

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.

jasperkennis avatar jasperkennis commented on August 20, 2024

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.

metaskills avatar metaskills commented on August 20, 2024

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.

jasperkennis avatar jasperkennis commented on August 20, 2024

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.

jasperkennis avatar jasperkennis commented on August 20, 2024

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.

metaskills avatar metaskills commented on August 20, 2024

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.

jasperkennis avatar jasperkennis commented on August 20, 2024

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.

metaskills avatar metaskills commented on August 20, 2024

Awesome! 🎆 Thanks for following up! Closing the ticket. Cheers!

from minitest-spec-rails.

jasperkennis avatar jasperkennis commented on August 20, 2024

Thanks for helping out!

from minitest-spec-rails.

maxbeizer avatar maxbeizer commented on August 20, 2024

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.

metaskills avatar metaskills commented on August 20, 2024

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.

maxbeizer avatar maxbeizer commented on August 20, 2024

@metaskills My apologies for the misplaced comment. I will delete, if you would like.

from minitest-spec-rails.

metaskills avatar metaskills commented on August 20, 2024

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.

maxbeizer avatar maxbeizer commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.