spec/lib/quandl/client/dataset/attributes_spec.rb in quandl_client-2.2.2 vs spec/lib/quandl/client/dataset/attributes_spec.rb in quandl_client-2.3.0

- old
+ new

@@ -8,9 +8,29 @@ s = create(:source, code: "QUANDL_CLIENT_TEST_SOURCE") unless s.exists? s } subject{ create(:dataset, source_code: source.code, private: true ) } + describe "#reference_url" do + let(:url){ "http://website.com/path/to/reference" } + let(:dataset){ Dataset.new( reference_url: url, code: "VALID" ) } + subject{ dataset } + + its(:reference_url){ should eq url } + its(:valid?){ should be_true } + + context "partial url" do + let(:url){ "website.com/path/to/reference" } + its(:valid?){ should be_false } + end + + context "invalid url" do + let(:url){ "website" } + its(:valid?){ should be_false } + end + + end + describe "#private" do it "should update to false" do subject.private = false subject.save \ No newline at end of file