Evaluate JavaScript Date objects
This commit is contained in:
parent
18651a0caf
commit
ed34e301ab
|
@ -479,6 +479,11 @@ describe Capybara::Webkit::Driver do
|
|||
result.should eq nil
|
||||
end
|
||||
|
||||
it "evaluates Javascript and returns a date" do
|
||||
result = driver.evaluate_script(%<new Date("2016-04-01T00:00:00Z")>)
|
||||
result.should eq "2016-04-01T00:00:00Z"
|
||||
end
|
||||
|
||||
it "evaluates Javascript and returns an object" do
|
||||
result = driver.evaluate_script(%<({ 'one' : 1 })>)
|
||||
result.should eq 'one' => 1
|
||||
|
|
|
@ -46,6 +46,11 @@ void JsonSerializer::addVariant(const QVariant &object) {
|
|||
m_buffer.append(object.toString());
|
||||
break;
|
||||
}
|
||||
case QMetaType::QDateTime:
|
||||
{
|
||||
addString(object.toString());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
m_buffer.append("null");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue