@@ -186,6 +186,30 @@ describe Agents::JavaScriptAgent do |
||
| 186 | 186 |
@agent.save! |
| 187 | 187 |
expect { @agent.reload.memory }.not_to raise_error
|
| 188 | 188 |
end |
| 189 |
+ |
|
| 190 |
+ it "it stores null" do |
|
| 191 |
+ @agent.options['code'] = 'Agent.check = function() {
|
|
| 192 |
+ this.memory("foo", "test");
|
|
| 193 |
+ this.memory("foo", null);
|
|
| 194 |
+ };' |
|
| 195 |
+ @agent.save! |
|
| 196 |
+ @agent.check |
|
| 197 |
+ expect(@agent.memory['foo']).to eq(nil) |
|
| 198 |
+ @agent.save! |
|
| 199 |
+ expect { @agent.reload.memory }.not_to raise_error
|
|
| 200 |
+ end |
|
| 201 |
+ |
|
| 202 |
+ it "it stores false" do |
|
| 203 |
+ @agent.options['code'] = 'Agent.check = function() {
|
|
| 204 |
+ this.memory("foo", "test");
|
|
| 205 |
+ this.memory("foo", false);
|
|
| 206 |
+ };' |
|
| 207 |
+ @agent.save! |
|
| 208 |
+ @agent.check |
|
| 209 |
+ expect(@agent.memory['foo']).to eq(false) |
|
| 210 |
+ @agent.save! |
|
| 211 |
+ expect { @agent.reload.memory }.not_to raise_error
|
|
| 212 |
+ end |
|
| 189 | 213 |
end |
| 190 | 214 |
|
| 191 | 215 |
describe "deleteKey" do |