Git Product home page Git Product logo

rails-amusement-park-v-000's Introduction

Rails Amusement Park

Objectives

Get comfortable with using form helpers, having models interact with each other, and building out a simple sessions system.

You're going to be building an amusement park. There will be users, attractions, and users can take rides on attractions.

Instructions

  • Check out The Demo to see where this lab is headed.
  • This is a test driven lab, check out the model tests and get those to pass before moving onto the feature specs.
  • Remember, if you use scaffolds or generators do not overwrite the model specs that are included in this lab. Always use the --no-test-framework flag and enter n or no when prompted to overwrite the model specs for this lab.

A hint about requiring a password: ActiveRecord comes with a handy has_secure_password attribute that you can set on a model. It requires that you enable the bcrypt gem and that you add a password_digest column to your model. You can read more about has_secure_password here.

Resources

rails-amusement-park-v-000's People

Contributors

curiositypaths avatar danielseehausen avatar hansenjl avatar johann avatar kkterai avatar lizbur10 avatar maxwellbenton avatar morgvanny avatar sdcrouse avatar sgharms avatar sylwiavargas avatar taoliu12 avatar timothylevi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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

rails-amusement-park-v-000's Issues

The master branch is the same as the solution

I reported this issue to one of the Learn instructors during my pairing session. I deleted all the migrations, models, controllers so that all the tests were failing. Then I did the lab from scratch and got the tests passing. It's been 3 days since I reported this issue.

Conflicting tests: 'redirects to home page if not logged in'

users_features_spec 48:

it 'prevents user from viewing user show page and redirects to home page if not logged in' do
    create_standard_user
    visit '/users/1'
    expect(current_path).to eq('/')
    expect(page).to have_content("Sign Up")
  end

The previous test requires creating a user to also log them in, but now this test doesn't log them out before visiting '/users/1', even though it is testing what happens if a user is logged out.

Difference in user_login helper method and session new view in Solution and Master

The solution user_login tells capybara to fill in a field on a from:
fill_in("user[name]", :with => "Mindy")

Whereas the master branch user_login say to select the name from the drop-down menu:
select 'Mindy',from:'user_name'

This confused a student, b/c the solution for 'sessions/new view' doesn't have code for a drop-down menu, like the test expects and the demo example shows.

login_helper.rb may need a second look

According to params the only way to make these tests pass is if the password fields are written as such for these two methods

def user_login
select 'Mindy',from:'user_name'
fill_in("user[password]", :with => "password")
click_button('Sign In')
end

def admin_login
select 'Walt Disney',from:'user_name'
fill_in("user[password]", :with => "password")
click_button('Sign In')
end

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.