This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Person do | |
before(:each) { @person = Person.new(name: "John", description: "cool guy") } | |
it { @person.should be_valid } | |
it 'validates name' do | |
@person.name = '' | |
@person.should_not be_valid | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe 'logging in' do | |
it "lets the admin log in" do | |
visit login_path | |
page.should have_css("input#password") | |
fill_in "password", :with => "secret" | |
click_on "Log in" | |
page.should have_content("Sucessfully logged in") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FormBuilder for Ruby on Rails which produces HTML code compatible with Twitter Bootstrap | |
# horizontal forms styles (see here: http://twitter.github.com/bootstrap/base-css.html#forms) | |
# | |
# Features: | |
# * displays validation errors in-line | |
# * has custom option - label-text - to override default label text for an input | |
# | |
# Requirements: | |
# By default, Rails will wrap a field with validation error in an ugly div tag that breaks | |
# the layout. To override this behaviour, add |