Sha256: 2deec253de5a49a6b706069336ddb6063eee9f711fda5f657caaa24fb7f2e535
Contents?: true
Size: 1010 Bytes
Versions: 20
Compression:
Stored size: 1010 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Source do let(:source){ build(:source) } context "without token" do before(:all){ Quandl::Client.token = '' } subject{ source } its(:valid?){ should be_true } describe "#save" do it "should not be authorized to create a source" do source.save source.status.should eq 401 end end end context "with token" do before(:all){ Quandl::Client.token = ENV['QUANDL_AUTH_TOKEN'] } describe "#save" do it "should save the source" do source.save source.status.should eq 201 end it "should update the source" do source.save retrieved_source = Source.find(source.id) retrieved_source.description = "something new #{Time.now}" retrieved_source.save Source.find(source.id).description.should eq retrieved_source.description end end end end
Version data entries
20 entries across 20 versions & 1 rubygems