Sha256: e35b25a0a839c432930aff42d4f7cda18b8e5477aed0e56cb92ffe75add0f08e

Contents?: true

Size: 1.35 KB

Versions: 16

Compression:

Stored size: 1.35 KB

Contents

FactoryGirl.define do
  factory :yuri_unicorn_resource, class: PublishMyData::Resource do
    initialize_with { new(uri, graph_uri) }
    ignore do
      uri { "http://#{PublishMyData.local_domain}/id/unicorns/yuri" }
      graph_uri { "http://#{PublishMyData.local_domain}/graph/unicorns" }
    end
    after(:build) do |res|
      res.write_predicate(RDF::RDFS.label, 'Yuri The Unicorn')
    end
  end

  factory :boris_unicorn_resource, class: PublishMyData::Resource do
    initialize_with { new(uri, graph_uri) }
    ignore do
      uri { "http://#{PublishMyData.local_domain}/id/unicorns/boris" }
      graph_uri { "http://#{PublishMyData.local_domain}/graph/unicorns" }
    end
    after(:build) do |res|
      res.write_predicate(RDF::RDFS.label, 'Boris The Unicorn')
      res.write_predicate('http://example.com/knows', RDF::URI("http://pmdtest.dev/id/unicorns/yuri")) # knows yuri
      res.write_predicate('http://example.com/resides-in', RDF::URI("http://locations.example.com/foo")) # resides in foo county
    end
  end

  factory :foreign_resource, class: PublishMyData::Resource do
    initialize_with { new(uri, graph_uri) }
    ignore do
      uri { "http://locations.example.com/foo" }
      graph_uri { "http://#{PublishMyData.local_domain}/geo" }
    end
    after(:build) do |res|
      res.write_predicate(RDF::RDFS.label, 'Foo County')
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
publish_my_data-0.0.20 spec/factories/resource_factories.rb
publish_my_data-0.0.19 spec/factories/resource_factories.rb
publish_my_data-0.0.18 spec/factories/resource_factories.rb
publish_my_data-0.0.17 spec/factories/resource_factories.rb
publish_my_data-0.0.16 spec/factories/resource_factories.rb
publish_my_data-0.0.15 spec/factories/resource_factories.rb
publish_my_data-0.0.14 spec/factories/resource_factories.rb
publish_my_data-0.0.13 spec/factories/resource_factories.rb
publish_my_data-0.0.12 spec/factories/resource_factories.rb
publish_my_data-0.0.11 spec/factories/resource_factories.rb
publish_my_data-0.0.10 spec/factories/resource_factories.rb
publish_my_data-0.0.9 spec/factories/resource_factories.rb
publish_my_data-0.0.8 spec/factories/resource_factories.rb
publish_my_data-0.0.7 spec/factories/resource_factories.rb
publish_my_data-0.0.5 spec/factories/resource_factories.rb
publish_my_data-0.0.4 spec/factories/resource_factories.rb