Skip to content

Instantly share code, notes, and snippets.

@yatmsu
Last active September 15, 2015 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yatmsu/9b93bbd0c8e992de6f7d to your computer and use it in GitHub Desktop.
Save yatmsu/9b93bbd0c8e992de6f7d to your computer and use it in GitHub Desktop.
spec/forms/application_form_builder_spec.rb
require 'rails_helper'
RSpec.describe ApplicationFormBuilder do
describe '#select_genders' do
let(:user) { User.create(name: 'name', gender: 'male') }
let(:builder){ ApplicationFormBuilder.new :user, user, ActionView::Base.new, {} }
it {
expect(builder.select_genders).to eq '<select name="user[gender]" id="user_gender"><option selected="selected" value="male">male</option>
<option value="fmale">fmale</option></select>'
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment