Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.