Sha256: 7fa7a6fc4c5f2df10ac9291668e93b7e756d6135fd0c333a4901b29a909f6085

Contents?: true

Size: 1012 Bytes

Versions: 9

Compression:

Stored size: 1012 Bytes

Contents

require 'spec_helper'

describe 'Using resources through sync api' do
  it 'should create new project in Syncano' do
    count_before = @sync_client.projects.count
    @sync_client.projects.create(name: 'Test project', description: 'Just testing')
    count_after = @sync_client.projects.count

    (count_after - count_before).should == 1
    @sync_client.projects.last[:name].should == 'Test project'
  end

  it 'should get projects' do
    projects = @sync_client.projects.all
    projects.each do |project|
      project.id.should_not be_nil
      project[:name].should_not be_nil
    end
  end

  it 'should get one project' do
    projects = @sync_client.projects.all

    project = @sync_client.projects.find(projects.last.id)
    project[:name].should == projects.last[:name]
  end

  it 'should destroy project' do
    count_before = @sync_client.projects.count
    @sync_client.projects.last.destroy
    count_after = @sync_client.projects.count

    (count_before - count_after).should == 1
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
syncano-3.1.4 spec/sync_resources_spec.rb
syncano-3.1.3 spec/sync_resources_spec.rb
syncano-3.1.2 spec/sync_resources_spec.rb
syncano-3.1.1 spec/sync_resources_spec.rb
syncano-3.1.1.beta5 spec/sync_resources_spec.rb
syncano-3.1.1.beta4 spec/sync_resources_spec.rb
syncano-3.1.1.beta3 spec/sync_resources_spec.rb
syncano-3.1.1.beta2 spec/sync_resources_spec.rb
syncano-3.1.1.beta spec/sync_resources_spec.rb