Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update Grails example caused by Twitter change #49

Merged
merged 3 commits into from

2 participants

Nobuhiro Sue Rob Fletcher
Nobuhiro Sue

Functional test in Grails example was broken because Twitter changed to show its

dynamically using ajax.
I updated Grails exapmle and test to use m.twitter.com. It is static page so useful to check user existence.
nobusue added some commits
Nobuhiro Sue nobusue Fix TimeZone issue in testcase c0e4aa8
Nobuhiro Sue nobusue Merge branch 'master' of github.com:nobusue/betamax ab84df2
Nobuhiro Sue nobusue Update grails sample to follow Twitter behaviour change
Twitter web recently changed its <title> displaying method using ajax.
Initially, the title is just "twitter" only, after it changes.
I updated to use Twitter mobile web.(grails sample and test)
5080e21
Rob Fletcher robfletcher merged commit a6bed99 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 6, 2011
  1. Nobuhiro Sue
Commits on Dec 17, 2011
  1. Nobuhiro Sue
  2. Nobuhiro Sue

    Update grails sample to follow Twitter behaviour change

    nobusue authored
    Twitter web recently changed its <title> displaying method using ajax.
    Initially, the title is just "twitter" only, after it changes.
    I updated to use Twitter mobile web.(grails sample and test)
This page is out of date. Refresh to see the latest.
2  examples/grails-betamax/grails-app/views/twitter/tweets.gsp
View
@@ -4,7 +4,7 @@
<li>
<blockquote>
<p>${it.text}</p>
- <small><a href="http://twitter.com/${it.user}" rel="external">@${it.user}</a></small>
+ <small><a href="http://m.twitter.com/${it.user}" rel="external">@${it.user}</a></small>
</blockquote>
</li>
</g:each>
3  examples/grails-betamax/test/functional/betamax/examples/TwitterPageSpec.groovy
View
@@ -25,6 +25,7 @@ class TwitterPageSpec extends GebSpec {
def proxyConfig = new ProxyConfig("localhost", 5555)
proxyConfig.addHostsToProxyBypass("localhost")
driver.webClient.proxyConfig = proxyConfig
+ //driver.setJavascriptEnabled(true) //not work. see http://groups.google.com/group/webdriver/browse_thread/thread/6bbb18dca79c4e92?pli=1
}
@Betamax(tape = "twitter success")
@@ -50,7 +51,7 @@ class TwitterPageSpec extends GebSpec {
$('#tweets li').eq(0).find('small a').click()
then:
- title == "Christine Romero (@la_dyosa) on Twitter"
+ $('div.user-screen-name').text() == "la_dyosa (Christine Romero)"
}
}
5 src/test/groovy/betamax/tape/ReadTapeFromYamlSpec.groovy
View
@@ -26,11 +26,14 @@ interactions:
"""
when:
def tape = YamlTape.readFrom(new StringReader(yaml))
+ def utc = Calendar.getInstance(TimeZone.getTimeZone('UTC'))
+ utc.set(2011, 7, 23, 22, 41, 40)
+ utc.set(Calendar.MILLISECOND, 0)
then:
tape.name == "single_interaction_tape"
tape.interactions.size() == 1
- tape.interactions[0].recorded == new Date(111, 7, 23, 23, 41, 40)
+ tape.interactions[0].recorded == utc.time
tape.interactions[0].request.method == "GET"
tape.interactions[0].request.uri == "http://icanhascheezburger.com/".toURI()
tape.interactions[0].response.status == HTTP_OK
Something went wrong with that request. Please try again.