Sha256: bbf81a1d806a00678b028a9834e04c46b768678091db96b4fdfd83f2b849369d
Contents?: true
Size: 1.23 KB
Versions: 31
Compression:
Stored size: 1.23 KB
Contents
require 'spec_helper' describe Krikri::LDP::Resource do before do class DummyResource; include Krikri::LDP::Resource; end subject.connection_uri = 'http://localhost:8080/marmotta/ldp' end subject { DummyResource.new } let(:base_uri) { 'http://localhost:8080/marmotta/ldp/container' } let(:slug) { 'moomin' } it 'has a connection' do expect(subject.ldp_connection).to be_a Faraday::Connection require 'pry' binding.pry end describe '#create' do it 'creates ldp resources' do require 'pry' binding.pry expect { subject.create(base_uri, nil) }.not_to raise_error end it 'accepts slug' do expect(subject.create(base_uri, nil, :Slug => slug) .env['response_headers']['location']) .to eq 'http://localhost:8080/marmotta/ldp/container/moomin' end end describe '#save' do it 'is idempotent' do first = subject.save(base_uri, nil, :Slug => slug) second = subject.save(base_uri, nil, :Slug => slug) expect(first.env['response_headers']['location']) .to eq second.env['response_headers']['location'] end end describe '#exists?' do it "knows it doesn't exist" do expect(subject).not_to exist end end end
Version data entries
31 entries across 31 versions & 1 rubygems