Sha256: 67466d24231538b0c33c20adf2de85d985eda044abf3d9651985a72b953dcad2

Contents?: true

Size: 1020 Bytes

Versions: 67

Compression:

Stored size: 1020 Bytes

Contents

require 'spec_helper'

describe "A visitor viewing a def" do

  context "where a resource exists in the database for that URI" do
    before do
      @resource = FactoryGirl.create(:mean_result)
    end

    context 'for HTML format' do
      it "should render a page about it (no redirect)" do
        visit @resource.uri.to_s
        page.current_url.should eq(@resource.uri.to_s)
        page.should have_content @resource.uri.to_s
      end
    end

    context 'for an alternative format' do

      context 'with accept header' do

        before do
          page.driver.header 'Accept','application/n-triples'
        end

        it 'should respond with the right format' do
          visit @resource.uri.to_s
          page.source.should == @resource.to_nt
        end

      end

      context 'with format extension' do

        it 'should respond with the right format' do
          visit @resource.uri.to_s + '.rdf'
          page.source.should == @resource.to_rdf
        end

      end

    end

  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
publish_my_data-1.3.25 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.24 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.23 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.22 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.21 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.20 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.19 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.18 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.17 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.16 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.15 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.14 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.13 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.12 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.11 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.10 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.9 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.8 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.7 spec/features/viewing_a_def_spec.rb
publish_my_data-1.3.6 spec/features/viewing_a_def_spec.rb