Sha256: 64a9fb4e24be08d3f7f57ab633b2ad2f5c5502e1000645e9cc6520dc531343ad

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

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

      context 'page content' do

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

        it 'talks about resources' do
          expect(page).to have_text('Resources')
        end
      end
    end

    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

        it 'talks about a new resource' do
          expect(page.text).to match(/new resource/i)
        end

        it 'has a select box array with schema:givenName as option' do
          expect(page).to have_select('predicate[]', options: ['schema:givenName','schema:familyName'])
        end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dbd_data_engine-0.0.4 spec/features/resources_spec.rb
dbd_data_engine-0.0.3 spec/features/resources_spec.rb
dbd_data_engine-0.0.2 spec/features/resources_spec.rb