Sha256: af5fce41bb1a5da9d990dc19c4c8b298cdf146108b2aa8338e71eeaab1b05627

Contents?: true

Size: 737 Bytes

Versions: 3

Compression:

Stored size: 737 Bytes

Contents

require 'spec_helper'

module PublishMyData
  describe Dataset do

    describe ".uri_from_slug" do
      it "returns a uri given a slug" do
        slug = "sluggy/my-slug"
        Dataset.uri_from_slug(slug).should == "http://pmdtest.dev/data/#{slug}"
      end
    end

    describe ".slug_from_uri" do
      it "returns a slug given a uri" do
        slug = "sluggy/my-slug"
        Dataset.slug_from_uri("http://pmdtest.dev/data/#{slug}").should == slug
      end
    end

    describe ".find_by_slug" do
      it "should perform a find on the uri for the slug" do
        slug = "sluggy/my-slug"
        Dataset.should_receive(:find).with(Dataset.uri_from_slug(slug))
        Dataset.find_by_slug(slug)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
publish_my_data-0.0.23 spec/models/publish_my_data/dataset_spec.rb
publish_my_data-0.0.22 spec/models/publish_my_data/dataset_spec.rb
publish_my_data-0.0.21 spec/models/publish_my_data/dataset_spec.rb