Permalink
Browse files

GRAILS-9040 - fix flash.now

flash.getNow() was working but flash.now was not.
  • Loading branch information...
jeffbrown committed Apr 19, 2012
1 parent d1635f6 commit b5432b2a9131cbf4b3375a208bc9bce959f09773
@@ -0,0 +1,18 @@
+package org.codehaus.groovy.grails.web.servlet
+
+import spock.lang.Specification
+
+
+class GrailsFlashScopeSpec extends Specification {
+
+ void 'Test accessing flash.now as a property'() {
+ given:
+ def flash = new GrailsFlashScope()
+
+ when:
+ flash.now.title = 'Grails'
+
+ then:
+ 'Grails' == flash.now.title
+ }
+}
@@ -135,6 +135,8 @@ public Set keySet() {
public Object get(Object key) {
if (next.containsKey(key)) {
return next.get(key);
+ } else if("now".equals(key)) {
+ return getNow();
}
return current.get(key);
}

0 comments on commit b5432b2

Please sign in to comment.