mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
models with rspec3 syntax
This commit is contained in:
@ -16,7 +16,7 @@ describe OptimizedImage do
|
||||
|
||||
it "returns nil" do
|
||||
OptimizedImage.expects(:resize).returns(false)
|
||||
OptimizedImage.create_for(upload, 100, 200).should == nil
|
||||
expect(OptimizedImage.create_for(upload, 100, 200)).to eq(nil)
|
||||
end
|
||||
|
||||
end
|
||||
@ -39,11 +39,11 @@ describe OptimizedImage do
|
||||
|
||||
it "works" do
|
||||
oi = OptimizedImage.create_for(upload, 100, 200)
|
||||
oi.sha1.should == "da39a3ee5e6b4b0d3255bfef95601890afd80709"
|
||||
oi.extension.should == ".png"
|
||||
oi.width.should == 100
|
||||
oi.height.should == 200
|
||||
oi.url.should == "/internally/stored/optimized/image.png"
|
||||
expect(oi.sha1).to eq("da39a3ee5e6b4b0d3255bfef95601890afd80709")
|
||||
expect(oi.extension).to eq(".png")
|
||||
expect(oi.width).to eq(100)
|
||||
expect(oi.height).to eq(200)
|
||||
expect(oi.url).to eq("/internally/stored/optimized/image.png")
|
||||
end
|
||||
|
||||
end
|
||||
@ -59,7 +59,7 @@ describe OptimizedImage do
|
||||
|
||||
it "returns nil" do
|
||||
OptimizedImage.expects(:resize).returns(false)
|
||||
OptimizedImage.create_for(upload, 100, 200).should == nil
|
||||
expect(OptimizedImage.create_for(upload, 100, 200)).to eq(nil)
|
||||
end
|
||||
|
||||
end
|
||||
@ -78,11 +78,11 @@ describe OptimizedImage do
|
||||
|
||||
it "works" do
|
||||
oi = OptimizedImage.create_for(upload, 100, 200)
|
||||
oi.sha1.should == "da39a3ee5e6b4b0d3255bfef95601890afd80709"
|
||||
oi.extension.should == ".png"
|
||||
oi.width.should == 100
|
||||
oi.height.should == 200
|
||||
oi.url.should == "/externally/stored/optimized/image.png"
|
||||
expect(oi.sha1).to eq("da39a3ee5e6b4b0d3255bfef95601890afd80709")
|
||||
expect(oi.extension).to eq(".png")
|
||||
expect(oi.width).to eq(100)
|
||||
expect(oi.height).to eq(200)
|
||||
expect(oi.url).to eq("/externally/stored/optimized/image.png")
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user