mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
correct broken spec
This commit is contained in:
parent
ec496a71b1
commit
5fd0841563
3 changed files with 20 additions and 14 deletions
|
@ -3,18 +3,6 @@ require 'distributed_cache'
|
|||
|
||||
describe DistributedCache do
|
||||
|
||||
def wait_for(&blk)
|
||||
i = 0
|
||||
result = false
|
||||
while !result && i < 300
|
||||
result = blk.call
|
||||
i += 1
|
||||
sleep 0.001
|
||||
end
|
||||
|
||||
result.should == true
|
||||
end
|
||||
|
||||
let! :cache1 do
|
||||
DistributedCache.new("test")
|
||||
end
|
||||
|
|
|
@ -22,12 +22,17 @@ describe SiteText do
|
|||
SiteText.text_for("got.sso").frozen? == true
|
||||
|
||||
SiteSetting.enable_sso = true
|
||||
SiteText.text_for("got.sso").should == "got sso: true"
|
||||
wait_for do
|
||||
SiteText.text_for("got.sso") == "got sso: true"
|
||||
end
|
||||
|
||||
text.value = "I gots sso: %{enable_sso}"
|
||||
text.save!
|
||||
|
||||
SiteText.text_for("got.sso").should == "I gots sso: true"
|
||||
wait_for do
|
||||
SiteText.text_for("got.sso") == "I gots sso: true"
|
||||
end
|
||||
|
||||
SiteText.text_for("got.sso", enable_sso: "frog").should == "I gots sso: frog"
|
||||
end
|
||||
|
||||
|
|
|
@ -51,4 +51,17 @@ module Helpers
|
|||
yield(guardian) if block_given?
|
||||
Guardian.stubs(new: guardian).with(user)
|
||||
end
|
||||
|
||||
def wait_for(&blk)
|
||||
i = 0
|
||||
result = false
|
||||
while !result && i < 300
|
||||
result = blk.call
|
||||
i += 1
|
||||
sleep 0.001
|
||||
end
|
||||
|
||||
result.should == true
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue