Sha256: 7e6be0d1607705690f4a6f1e3831eb8cd5428e83ffbe7aeec225b3aae63ca784

Contents?: true

Size: 1017 Bytes

Versions: 7

Compression:

Stored size: 1017 Bytes

Contents

require File.join(File.dirname(__FILE__),'..','api_helper')

describe "RhoconnectApiUpdateSourceParams" do
  it_should_behave_like "ApiHelper" do
    it "should set poll_interval to 99 seconds" do
      @s1 = Source.load(@s.id,@s_params)
      before = @s1.poll_interval.to_i
      post "/api/source/update_source_params", :api_token => @api_token, 
        :source_name => @s_fields[:name], :user_name => @u_fields[:login], :data => {:poll_interval => 99}
      last_response.should be_ok
      @s2 = Source.load(@s.id,@s_params)
      after = @s2.poll_interval
      before.should == 300
      after.should == 99
    end

    it "should fail to update the source if param is not found" do
      post "/api/source/update_source_params", :api_token => @api_token, 
        :source_name => @s_fields[:name], :user_name => @u_fields[:login], :data => {:invalid_param => "invalid_data"}
        last_response.status.should == 500
        last_response.body.match('undefined method').should_not be_nil
    end
  end  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rhoconnect-3.2.1 spec/api/source/update_source_params_spec.rb
rhoconnect-3.2.0 spec/api/source/update_source_params_spec.rb
rhoconnect-3.2.0.beta5 spec/api/source/update_source_params_spec.rb
rhoconnect-3.2.0.beta4 spec/api/source/update_source_params_spec.rb
rhoconnect-3.2.0.beta3 spec/api/source/update_source_params_spec.rb
rhoconnect-3.2.0.beta2 spec/api/source/update_source_params_spec.rb
rhoconnect-3.2.0.beta1 spec/api/source/update_source_params_spec.rb