1
0
Fork 0
mirror of https://github.com/omniauth/omniauth.git synced 2022-11-09 12:31:49 -05:00
omniauth--omniauth/spec/omniauth/form_spec.rb

24 lines
766 B
Ruby
Raw Normal View History

2013-02-25 19:05:37 -05:00
require 'helper'
describe OmniAuth::Form do
2014-01-15 23:00:46 -05:00
describe '.build' do
it 'yields the instance when called with a block and argument' do
OmniAuth::Form.build { |f| expect(f).to be_kind_of(OmniAuth::Form) }
end
2014-01-15 23:00:46 -05:00
it 'evaluates in the instance when called with a block and no argument' do
OmniAuth::Form.build { |f| expect(f.class).to eq(OmniAuth::Form) }
end
end
2014-01-15 23:00:46 -05:00
describe '#initialize' do
it 'sets the form action to the passed :url option' do
expect(OmniAuth::Form.new(:url => '/awesome').to_html).to be_include("action='/awesome'")
end
2014-01-15 23:00:46 -05:00
it 'sets an H1 tag from the passed :title option' do
expect(OmniAuth::Form.new(:title => 'Something Cool').to_html).to be_include('<h1>Something Cool</h1>')
end
end
end