Sha256: f82c0500d57595bc0dd15ad19accc8c5747a1d91bf2a0b09642976c5de2cfd5b

Contents?: true

Size: 1.96 KB

Versions: 3

Compression:

Stored size: 1.96 KB

Contents

require 'spec_helper'

describe Reshape::Client::Models do
  let(:client) do
    shapeways_client
  end
  
  after(:each) do
    shapeways_client.reset
  end

  it "should list models in json" do
    VCR.use_cassette('models') do
      response = client.models
      response.should be_an_instance_of(Hashie::Mash)
      response.result.should == 'success'
    end
  end 
  
  it "should return model details in json" do
    VCR.use_cassette('model') do
      response = client.model(1114694)
      response.should be_an_instance_of(Hashie::Mash)
      response.result.should == 'success'
      response.modelId.should == '1114694'
    end
  end
  
  it "should add a new model" do
    pending 'Need to add STL file to fixtures'
  end
  
  it "should delete the model details in json" do
    pending 'Need to record deletion of a specific model id'
  end
  
  it "should return info about a specific model in json" do
    VCR.use_cassette('model_info') do
      response = client.model_info(1114694)
      response.should be_an_instance_of(Hashie::Mash)
      response.result.should == 'success'
      response.modelId.should == '1114694'
    end
  end
  
  it "should update model info" do
    VCR.use_cassette('update_model_info') do
      response = client.update_model_info(1114694, {description: 'USB thingy'})
      response.should be_an_instance_of(Hashie::Mash)
      response.result.should == 'success'
      response.description.should == 'USB thingy'
    end
  end
  
  it "should add a file to the model" do
    pending 'Need to add STL file to fixtures'
  end
  
  it "should return a model file by a specific version number" do
    VCR.use_cassette('model_file_by_version') do
      response = client.model_file_by_version(1114694, '1')
      response.should be_an_instance_of(Hashie::Mash)
      response.result.should == 'success'
      response.modelVersion.should == '1'
    end
  end
  
  it "should add a photo to the model" do
    pending "Need to add JPG file to fixutres"
  end
  
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reshape-0.2 spec/reshape/client/models_spec.rb
reshape-0.1.1 spec/reshape/client/models_spec.rb
reshape-0.1 spec/reshape/client/models_spec.rb