Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6673623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:38:57+00:00 2026-05-26T03:38:57+00:00

require ‘test_helper’ class MyTest < ActionController::IntegrationTest test view posts from login page do visit(/logins/new)

  • 0
    require 'test_helper'

     class MyTest < ActionController::IntegrationTest

      test "view posts from login page" do
      visit("/logins/new")
      find_field('Username').set('abode')
      find_field('Password').set('efghi')
      click_link_or_button('Login')
      assert page.has_content?('Signed in!')
      end

      test "go to new user page" do
        visit("/logins/new")
        click_link("New user?")
        assert (current_path == "/users/new")
      end

    end

   Error:
test_view_posts_from_login_page(MyTest):
ActionController::RoutingError: No route matches [POST] "/logins/new"
    test/integration/view_posts_test.rb:12:in `block in <class:MyTest>'

It shows error for line 12. Is there a problem with button “Login” or the /logins/new path? The second test passes though so the path should be correct? What am I doing wrong?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:38:58+00:00Added an answer on May 26, 2026 at 3:38 am

    It’s really hard to tell what’s going on here. In general if you are asking a question about a routing error you should post what’s in your routes.rb file as well.

    That being said, I think whatever HTML gets generated for the form has it’s action specified incorrectly.

    Example routes:

        tags GET    /tags(.:format)                {:action=>"index", :controller=>"tags"}
             POST   /tags(.:format)                {:action=>"create", :controller=>"tags"}
     new_tag GET    /tags/new(.:format)            {:action=>"new", :controller=>"tags"}
    edit_tag GET    /tags/:id/edit(.:format)       {:action=>"edit", :controller=>"tags"}
         tag GET    /tags/:id(.:format)            {:action=>"show", :controller=>"tags"}
             PUT    /tags/:id(.:format)            {:action=>"update", :controller=>"tags"}
             DELETE /tags/:id(.:format)            {:action=>"destroy", :controller=>"tags"}
    

    Notice where it says POST in the second column there. That means the action attribute for a new object form should be set to /tags. Having that there tells Rails to render the create action in the Tags controller. The same would be true for your login model.

    As far as what your form HTML code actually looks like, it probably looks something along the lines of:

    <form ... action="/logins/new" ...>...</form>
    

    When it should be

    <form ... action="/logins" ...>...</form>
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

require 'rubygems' require 'test/unit' class Thing attr_accessor :foo def set_stuff @foo = 'bar' end
When I require libraries from the ns form I get : test> (ns test
require 'digest' class UserMailer < ActionMailer::Base def receive_compliment(compliment) @recipients = #{compliment.receiver.email} @from = SERVICE_EMAIL
I require a tree / directed acyclic graph implementation something like this: public class
require_once('phpmailer/class.phpmailer.php'); function smtpmailer($to,$from,$subject,$body) { define('GUSER', 'xxx'); // Gmail username define('GPWD', 'xxx'); // Gmail password
require 'spec_helper' describe LayoutLinks do it should have a Home page at '/' do
I have this code: require(class.XMLHttpRequest.php); function hot($news){ $url=https://localhost/search.aspx?search=.$news.; $ajax=new XMLHttpRequest(); $ajax->setRequestHeader(Cookie,Cookie: host); $ajax->open(GET,$url,true); $ajax->send(null);
Given: require 'rubygems' require 'nokogiri' value = Nokogiri::HTML.parse(<<-HTML_END) <html> <body> <p id='para-1'>A</p> <div class='block'
I require one HTML element (Label) on my page to be unselectable for IE
require 'rubygems' require 'mechanize' agent = Mechanize.new page = agent.get(http://google.com/) This simple script works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.