spec/lib/quandl/client/dataset/attributes_spec.rb in quandl_client-2.3.2 vs spec/lib/quandl/client/dataset/attributes_spec.rb in quandl_client-2.4.0

- old
+ new

@@ -8,25 +8,27 @@ s = create(:source, code: "QUANDL_CLIENT_TEST_SOURCE") unless s.exists? s } subject{ create(:dataset, source_code: source.code, private: true ) } + describe "#name" do + subject{ create(:dataset, source_code: source.code, private: true, name: '' ) } + + its(:name){ should match /Untitled Dataset #{Date.today}/ } + end + 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 } + its(:reference_url){ should eq "http://website.com/path/to/reference" } + its(:valid?){ should be_true } end end describe "#private" do \ No newline at end of file