Sha256: b7a25a289a0bab6df9c1a1eab2fafecd4bd234f9b80ea372ef2237aef4fbf7c7

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe 'dbd_data_engine/resources/new.html.haml' do
  context 'renders' do

    before(:each) do
      @contexts = ['a', 'b']
      @predicates = ['schema:givenName', 'schema:familyName']
      render
    end

    it 'without exceptions' do
      #should_not raise_error
    end

    it 'has table header "predicate"' do
      rendered.should have_css('table>tr>th', text: 'predicate')
    end

    it 'has table header "object"' do
      rendered.should have_css('table>tr>th', text: 'object')
    end

    it 'has an array of drop down select boxes with predicates' do
      rendered.should have_select('predicate[]', options: ['schema:givenName', 'schema:familyName'])
    end

    it 'has a select box with contexts' do
      rendered.should have_select('context', options: ['a', 'b'])
    end

    it 'has an array of fields with objects' do
      rendered.should have_field('object[]')
    end

    it 'has a submit button' do
      rendered.should have_button('Submit')
    end

    it 'has a form that posts to /data/resources' do
      rendered.should have_css('form[@action="/data/resources"][@method="post"]', text: 'predicate')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dbd_data_engine-0.0.10 spec/views/dbd_data_engine/resources/new.html.haml_spec.rb
dbd_data_engine-0.0.9 spec/views/dbd_data_engine/resources/new.html.haml_spec.rb
dbd_data_engine-0.0.8 spec/views/dbd_data_engine/resources/new.html.haml_spec.rb
dbd_data_engine-0.0.7 spec/views/dbd_data_engine/resources/new.html.haml_spec.rb
dbd_data_engine-0.0.6 spec/views/dbd_data_engine/resources/new.html.haml_spec.rb