Sha256: 26f4206df9a874bcd54eb6e54d78c3b02f49e5d640b746e11ef9c3539e3765ba

Contents?: true

Size: 450 Bytes

Versions: 7

Compression:

Stored size: 450 Bytes

Contents

$LOAD_PATH << File.dirname(__FILE__)
require 'spec_helper'

describe 'A REST adapter' do

  before do
    @adapter = DataMapper::Repository.adapters[:default]
  end

  describe 'when saving a resource' do

    before do
      @book = Book.new(:title => 'Hello, World!', :author => 'Anonymous')
    end

    it 'should make an HTTP Post' do
      @adapter.should_receive(:http_post).with('/books.xml', @book.to_xml)
      @book.save
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dm-rest-adapter-0.9.7 spec/create_spec.rb
dm-rest-adapter-0.9.9 spec/create_spec.rb
dm-rest-adapter-0.9.10 spec/create_spec.rb
dm-rest-adapter-0.9.4 spec/create_spec.rb
dm-rest-adapter-0.9.5 spec/create_spec.rb
dm-rest-adapter-0.9.6 spec/create_spec.rb
dm-rest-adapter-0.9.8 spec/create_spec.rb