mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
hidden and deleted state in user stream
This commit is contained in:
@ -18,13 +18,18 @@ describe SqlBuilder do
|
||||
end
|
||||
end
|
||||
|
||||
describe "map" do
|
||||
describe "map_exec" do
|
||||
class SqlBuilder::TestClass
|
||||
attr_accessor :int, :string, :date, :text
|
||||
attr_accessor :int, :string, :date, :text, :bool
|
||||
end
|
||||
|
||||
it "correctly maps to a klass" do
|
||||
rows = SqlBuilder.new("SELECT 1 AS int, 'string' AS string, CAST(NOW() at time zone 'utc' AS timestamp without time zone) AS date, 'text'::text AS text")
|
||||
rows = SqlBuilder.new("SELECT
|
||||
1 AS int,
|
||||
'string' AS string,
|
||||
CAST(NOW() at time zone 'utc' AS timestamp without time zone) AS date,
|
||||
'text'::text AS text,
|
||||
true AS bool")
|
||||
.map_exec(SqlBuilder::TestClass)
|
||||
|
||||
rows.count.should == 1
|
||||
@ -32,6 +37,7 @@ describe SqlBuilder do
|
||||
row.int.should == 1
|
||||
row.string.should == "string"
|
||||
row.text.should == "text"
|
||||
row.bool.should == true
|
||||
row.date.should be_within(10.seconds).of(DateTime.now)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user