Sha256: 1e163b24a753572380b8506a3db3517eea0a4fcaaf8b68147bc4402e84437587

Contents?: true

Size: 725 Bytes

Versions: 6

Compression:

Stored size: 725 Bytes

Contents

require 'rails_core_extensions/action_view_extensions'

require 'action_view'

describe RailsCoreExtensions::ActionViewExtensions do
  before do
    class TestModel1
      include ActionView::Helpers::FormTagHelper
      include ActionView::Helpers::FormOptionsHelper
      include RailsCoreExtensions::ActionViewExtensions
    end
  end

  after { Object.send(:remove_const, 'TestModel1') }

  subject { TestModel1.new }

  context '#boolean_select_tag' do
    it 'should generate and have selected element selected' do
      expect(subject.boolean_select_tag('name', selected: '0')).to eq(
        subject.select_tag('name', subject.options_for_select([['Yes', '1'], ['No', '0']], selected: '0'))
      )
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_core_extensions-0.4.0 spec/action_view_extensions_spec.rb
rails_core_extensions-0.3.0 spec/action_view_extensions_spec.rb
rails_core_extensions-0.2.0 spec/action_view_extensions_spec.rb
rails_core_extensions-0.1.1 spec/action_view_extensions_spec.rb
rails_core_extensions-0.1.0 spec/action_view_extensions_spec.rb
rails_core_extensions-0.0.1 spec/action_view_extensions_spec.rb