GithubHelp home page GithubHelp logo

returning-string-data-v-000's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

returning-string-data-v-000's Issues

The README code runs in the browser but throws 5 failures

A student asked about this README - It works in the browser but the tests don't pass. I ran my own copy of it off my github and got the same result.

  1. navigate shows the title on the show page in a h1 tag
    Failure/Error: <%= @post.author.name %>

    ActionView::Template::Error:
    undefined method `name' for nil:NilClass

  2. navigate to post pages
    Failure/Error: <%= @post.author.name %>

    ActionView::Template::Error:
    undefined method `name' for nil:NilClass

  3. navigate shows the description on the show page in a p tag
    Failure/Error: <%= @post.author.name %>

    ActionView::Template::Error:
    undefined method `name' for nil:NilClass

  4. form shows a new form that submits content and redirects and prints out params
    Failure/Error: fill_in 'title', with: "My post title"

    Capybara::ElementNotFound:
    Unable to find field "title"

  5. form shows a new form that submits content and redirects and prints out params
    Failure/Error: click_on "Update Post"

    ActionController::RoutingError:
    No route matches [PATCH] "/posts/1"

solution to have the tests passed

  1. the tests are not creating an author and a hometown, so it is conflicting.
    easy fix : remove the <%= @post.author.name %> and <%= @post.author.hometown %> from show.html.erb

2.the tests are not testing the title and description as attached to a @post.
fill_in 'title', with: "My post title"
fill_in 'description', with: "My post description"

replace everywhere by
fill_in 'post[title]', with: "My post title"
fill_in 'post[description]', with: "My post description"

  1. The test wants "Submit Post" instead of "Create Post". Rails is taking the name of the method of the form to define the value of the button so that is most likely what we really want.
    Change the test to : click_on "Create Post"
    (if we want to change the value on the form instead, we would have to have 2 different forms for new and edit)

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.