Git Product home page Git Product logo

Comments (7)

KenLast avatar KenLast commented on June 28, 2024

I ran into this too, from railstutorial chapter 13 in the microposts_interface_test. It comes from the each line:
post microposts_path, micropost: { parameters in here }

I changed that to:
post microposts_path, params: { micropost: { parameters in here } }

and this made the test work without any warnings

from tiddle.

adamniedzielski avatar adamniedzielski commented on June 28, 2024

@KenLast Thank you for reporting your findings. That's exactly the way how it should be solved! However, we need to test both under Rails 4.2 and Rails 5.0 and the new version is not available in Rails 4.2. This creates an interesting problem how to support both versions of Rails at the same time.

from tiddle.

KenLast avatar KenLast commented on June 28, 2024

Adam,

What are you working on? I am quite new to both Rails and Ruby, as my only
experience with either is working through Michael Hartl's railstutorial.

However, it seems that Ruby is quite open to redefinitions. Is it possible
to redefine the HTTP request parameter format conditionally based on Ruby
version?

Ken

On Mon, Sep 26, 2016 at 10:31 AM, Adam Niedzielski <[email protected]

wrote:

@KenLast https://github.com/KenLast Thank you for reporting your
findings. That's exactly the way how it should be solved! However, we need
to test both under Rails 4.2 and Rails 5.0 and the new version is not
available in Rails 4.2. This creates an interesting problem how to support
both versions of Rails at the same time.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#30 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVZzCAstPC-GByLoT5jDIth80If__X8-ks5quAGPgaJpZM4JDYYD
.

from tiddle.

adamniedzielski avatar adamniedzielski commented on June 28, 2024

I'm not working on this issue at this moment, because it's not super critical. I left it here for anyone willing to contribute to the gem.

Yes, it may be tempting to redefine the method, because it's so easy in Ruby. However, from my experience, it is usually confusing to other developers and makes the codebase more difficult to understand. What I would prefer in this case is to define a test helper (spec/support) which checks for Rails version and invokes the method with the correct way of passing arguments.

I can help you a bit if you want to submit a PR.

from tiddle.

KenLast avatar KenLast commented on June 28, 2024

What gem is this from? I thought it was just from Rails.

On Mon, Sep 26, 2016 at 1:39 PM, Adam Niedzielski [email protected]
wrote:

I'm not working on this issue at this moment, because it's not super
critical. I left it here for anyone willing to contribute to the gem.

Yes, it may be tempting to redefine the method, because it's so easy in
Ruby. However, from my experience, it is usually confusing to other
developers and makes the codebase more difficult to understand. What I
would prefer in this case is to define a test helper (spec/support) which
checks for Rails version and invokes the method with the correct way of
passing arguments.

I can help you a bit if you want to submit a PR.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#30 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVZzCOFg7kftTkcedWTEAYnifQ1rIdFtks5quC2dgaJpZM4JDYYD
.

from tiddle.

jessedo81 avatar jessedo81 commented on June 28, 2024

Was getting close to the same error in the railstutorial: test > integration > users_login_test.rb and changed from
post login_path, session: { email: @user.email, password: 'password' }
to
post login_path, params: {session: { email: @user.email, password: 'password' }}

worked like a charm.
thanks

from tiddle.

adamniedzielski avatar adamniedzielski commented on June 28, 2024

@KenLast yes, it's from Rails, but we have to solve this problem in this gem (Tiddle) to be compatible with both Rails 4.2 and Rails 5.0

@jessedo81 Thank you for your contribution and good luck starting with Rails!

from tiddle.

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.