Code Monkey home page Code Monkey logo

formal-affair-rails's Introduction

Formal Affair

Instructions

Three resources have been set up and each needs their own set of forms.

Run the tests and look in the "app/views" directory for where the forms will live.

  1. Babies
  • Use the form_for helper.
  1. Concretes
  • Use the form_tag helper.
  1. Searches
  • Use the HTML <form> tag.

Here's the Rails Form Helper Guide.

Rails uses CSRF tokens in its forms to defend against the [cross site request forgery vulnerability] (http://guides.rubyonrails.org/security.html#csrf-countermeasures).

When you're not using a Rails form helper, you'll need to insert your own CSRF token.

Deliverables

Fork this repository and deliver your solution in master.

Resources

View Formal Affair on Learn.co and start learning to code for free.

formal-affair-rails's People

Contributors

ahimmelstoss avatar annjohn avatar fislabstest avatar fs-lms-test-bot avatar irmiller22 avatar joshuabamboo avatar kthffmn avatar roseweixel avatar sarogers avatar

Watchers

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

formal-affair-rails's Issues

'name="commit" breaks tests

For some reason, the 'name="commit"' parameter in the " field keeps breaking the expected params test. I removed the 'name="commit"' parameter, and it passed the test.

horrible test suite

this test suite does not test that controller actions actually respond to form submission. you can pass tests w/o any code in create, update actions of concretes controller.

this test suite is using a global variable, $params, that is set in a before_filter of the application controller to steal form params during run of rspec.

tests to update concrete don't actually fill out any form fields to change the info about a given concrete

if you write the code to correctly update a concrete, redirect to show page, the test will fail.

expectations of tests flip test_params and expected_params such that we expect(expected_params).to eq(test_params) when test params are generated by run of test suite/dependent on user's code and expected params are hard coded by tests.

Time field and Test issue

The last test (line 39) in the baby_form_spec.rb only passes if you use a text_field for the "date-time" input on the form. When the form is submitted with a date_time field you get the absolute date/time (including seconds) "birth_date"=>"2014-02-14 05:00:00.000000"
The test is looking for only month/day/year.

The only way to pass this test in the current environment is to use a text_field form helper instead of date_field.

@jmburges @AnnJohn

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.