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 8596993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:48:44+00:00 2026-06-12T00:48:44+00:00

Thank for response. I getting error in application Git application with the error Failures:

  • 0

Thank for response.
I getting error in application Git application with the error

Failures:

  1) Page pages page creation with invalid information should not create a page
     Failure/Error: before(:each) { visit new_admin_page_path }
     NoMethodError:
       undefined method `visit' for #<Page:0x00000005094bb0>
     # ./spec/requests/page_request_spec.rb:13:in `block (3 levels) in <top (required)>'

  2) Page pages page creation with invalid information error messages 
     Failure/Error: before(:each) { visit new_admin_page_path }
     NoMethodError:
       undefined method `visit' for #<Page:0x000000051671f0>
     # ./spec/requests/page_request_spec.rb:13:in `block (3 levels) in <top (required)>'

Finished in 1.21 seconds
14 examples, 2 failures

What I’ve missed ?

  • 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-06-12T00:48:45+00:00Added an answer on June 12, 2026 at 12:48 am

    I cloned your repository and ran the spec. The problem is that you are using the term page for two different things, the Capybara page (subject { page }) and your model with the name Page (which you also name page). Those two names conflict, which is why rspec is complaining that there is no method visit for #<Page:0x00000005094bb0>.

    To solve this just rename the page you create in the initial let:

    let(:mypage) { Factory.create(:page) }
    

    That will avoid the conflict by naming your page model mypage instead of page.

    There are other issues however. Your user factory does not use a sequence for assigning emails, so you get a validation error because it says the email is already taken.

    I changed your user factory to this:

    sequence(:email) { |n| "abc#{n}@example.com"}
    factory :user do
      email
      password "foobar"
      password_confirmation "foobar"
      ...
    

    That fixes the validation error, but you now get another error. In the line in your first spec, you should be checking that count does not change on the class Page, not the record page (or mypage).

    So change that to:

    expect { click_button "Create Page" }.not_to change(Page, :count)
    

    This will still leave you with errors, because you also do not have any create action for your PagesController. From what you wrote, it seems like the information is invalid so it should not even get to this action. I don’t know exactly what you’re trying to do here so I’ll leave the rest for you to figure out.

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

Sidebar

Related Questions

I'm getting an ActionviewTemplate error when trying to POST using an ajax response. The
Help me please. After sending post query i have webexception Error getting response stream
I'm getting this error when trying to get instanse of class in separated Application
I'm building a simple FB application but I'm getting a weird error. I have
I am getting an EOFError (End Of File Error) on this code in my
I am getting the following error: The maximum message size quota for incoming messages
I am getting DataTables warning: JSON data from server could not be parsed. This
I am getting strange behavior, below is the jquery ajax call to my page.
I got an error as I mentioned above. My application has EJB WebServices, developing
I'm trying to use getServletContext().getRealPath( / ) , but I keep getting this error:

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.