File: form_spec.rb

package info (click to toggle)
ruby-omniauth 1.3.1-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 324 kB
  • sloc: ruby: 1,896; makefile: 3
file content (23 lines) | stat: -rw-r--r-- 766 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'helper'

describe OmniAuth::Form do
  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

    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

  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

    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