mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
models with rspec3 syntax
This commit is contained in:
parent
07540bcb49
commit
b52f12948a
17 changed files with 537 additions and 535 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue