spec/acfs_spec.rb in acfs-0.8.0 vs spec/acfs_spec.rb in acfs-0.9.0
- old
+ new
@@ -44,9 +44,20 @@
expect(stub).to have_been_requested
expect(@user).to_not be_changed
expect(@user).to be_persisted
end
+ it 'should create a single resource synchronously' do
+ stub = stub_request(:post, "http://users.example.org/sessions")
+ .to_return body: '{"id":"sessionhash","user":1}', headers: {'Content-Type' => 'application/json'}
+
+ session = Session.create ident: 'Anon'
+
+ expect(stub).to have_been_requested
+ expect(session.id).to be == 'sessionhash'
+ expect(session.user).to be == 1
+ end
+
it 'should load single resource' do
@user = MyUser.find(2)
expect(@user).to_not be_loaded