Sha256: 6875be698eaff5fcda769fabd32fd8dfc1f462b5f53af8c4760e9c9433e520f1

Contents?: true

Size: 716 Bytes

Versions: 63

Compression:

Stored size: 716 Bytes

Contents

require "spec_helper"

module Lines

  describe Picture do
    it "has a valid factory" do
      FactoryGirl.create(:picture).should be_valid
    end

    it "should trigger :update_used_images after save" do
      pic = FactoryGirl.create(:picture)
      article = FactoryGirl.create(:article, content: "![Alt text](#{pic.image.url})")
      article.should_receive(:update_used_images)
      article.save
    end

    it "should belong to article after used in article.content" do
      pic = FactoryGirl.create(:picture)
      article = FactoryGirl.create(:article, content: "![Alt text](#{pic.image.url})")
      article.used_images.should == [pic.id]
      article.pictures.first.should eq pic
    end
  end

end

Version data entries

63 entries across 63 versions & 2 rubygems

Version Path
jeygeethanmedia-inkpen-1.2.6.2 spec/models/lines/picture_spec.rb
jeygeethanmedia-inkpen-1.2.6.1 spec/models/lines/picture_spec.rb
lines-engine-1.2.6.1 spec/models/lines/picture_spec.rb
lines-engine-1.2.6 spec/models/lines/picture_spec.rb
lines-engine-1.2.5 spec/models/lines/picture_spec.rb
lines-engine-1.2.3 spec/models/lines/picture_spec.rb
lines-engine-1.2.2 spec/models/lines/picture_spec.rb
lines-engine-1.2.1.1 spec/models/lines/picture_spec.rb
lines-engine-1.2.1 spec/models/lines/picture_spec.rb
lines-engine-1.2 spec/models/lines/picture_spec.rb
lines-engine-1.1.5.3 spec/models/lines/picture_spec.rb
lines-engine-1.1.5.2 spec/models/lines/picture_spec.rb
lines-engine-1.1.5.1 spec/models/lines/picture_spec.rb
lines-engine-1.1.5 spec/models/lines/picture_spec.rb
lines-engine-1.1.4 spec/models/lines/picture_spec.rb
lines-engine-1.1.3 spec/models/lines/picture_spec.rb
lines-engine-1.1.2 spec/models/lines/picture_spec.rb
lines-engine-1.1.1 spec/models/lines/picture_spec.rb
lines-engine-1.1.0 spec/models/lines/picture_spec.rb
lines-engine-1.0.0 spec/models/lines/picture_spec.rb