Sha256: f0402ed861b575be269eae26904c18254ad745c8158f867c0f64711fbb2d6795

Contents?: true

Size: 1.63 KB

Versions: 1

Compression:

Stored size: 1.63 KB

Contents

require 'spec_helper'

module DbdDataEngine
  describe ResourcesController do
    describe 'GET /data/resources/new' do
      context 'routing' do
        it 'new_resources_path is correct' do
          dbd_data_engine.new_resource_path.should == '/data/resources/new'
        end
      end

      context 'page content' do

        before(:each) do
          visit(dbd_data_engine.new_resource_path)
        end

        context 'resource' do
          it 'talks about a new resource' do
            expect(page).to have_css('h1', text: 'Create a new resource')
          end

          it 'has the schema:about option' do
            expect(page).to have_css('select#predicate_ > option[value="schema:about"]')
          end

          it 'has a select box array with schema:givenName as option' do
            expect(page).to have_css('select#predicate_ > option[value="schema:givenName"]')
          end

          it 'has a select box array with schema:familyName as option' do
            expect(page).to have_css('select#predicate_ > option[value="schema:familyName"]')
          end

          it 'has a field array' do
            expect(page).to have_field('object[]')
          end
        end

        context 'select a context' do
          it 'has a label "context"' do
            expect(page).to have_css('label', text: 'Context')
          end

          it 'has a select box for the context' do
            expect(page).to have_select('context', [])
          end

          it 'has an option "public today"' do
            expect(page).to have_css('select#context > option[value="public today"]')
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dbd_data_engine-0.0.10 spec/features/resources/new_spec.rb