Sha256: 43492b35df84151500aea221b1251780326e3b48169d3715bb706eafe1992a00

Contents?: true

Size: 762 Bytes

Versions: 1

Compression:

Stored size: 762 Bytes

Contents

require 'spec_helper'

describe PostDecorator do
  subject { PostDecorator.new(source) }
  let(:source) { Post.create }

  it "can use path helpers with its model" do
    subject.path_with_model.should == "/en/posts/#{source.id}"
  end

  it "can use path helpers with its id" do
    subject.path_with_id.should == "/en/posts/#{source.id}"
  end

  it "can use url helpers with its model" do
    subject.url_with_model.should == "http://www.example.com:12345/en/posts/#{source.id}"
  end

  it "can use url helpers with its id" do
    subject.url_with_id.should == "http://www.example.com:12345/en/posts/#{source.id}"
  end

  it "can be passed implicitly to url_for" do
    subject.link.should == "<a href=\"/en/posts/#{source.id}\">#{source.id}</a>"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
draper-1.0.0 spec/dummy/spec/decorators/post_decorator_spec.rb