hidden and deleted state in user stream

This commit is contained in:
Sam
2013-06-12 11:14:08 +10:00
parent 6bf2f15610
commit c1f6169b48
7 changed files with 46 additions and 19 deletions

View File

@ -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