konacha:run tries to parse over-escaped JSON #30

Closed
trak3r opened this Issue Apr 17, 2012 · 7 comments

Comments

Projects
None yet
3 participants

trak3r commented Apr 17, 2012

the code:

@examples = JSON.parse(session.evaluate_script('Konacha.getResults()')).map do |row|

the stack trace:

756: unexpected token at '"[{"name": "includesDate", "passed": true},...
/Users/ted/.rvm/gems/ruby-1.9.2-p0/gems/json-1.6.5/lib/json/common.rb:148:in parse' /Users/ted/.rvm/gems/ruby-1.9.2-p0/gems/json-1.6.5/lib/json/common.rb:148:inparse'
/Users/ted/.rvm/gems/ruby-1.9.2-p0/gems/konacha-1.1.0/lib/konacha/runner.rb:82:in `run'

Collaborator

joliss commented Apr 17, 2012

Can you provide some more detail on how to reproduce this? The line you posted is working OK for me (konacha:run passes).

trak3r commented Apr 17, 2012

sure, i can provide as much as you need.

here's my config:

Konacha.configure do |config|
config.spec_dir = "test/javascripts"
config.driver = :selenium
end if defined?(Konacha)

here's my gem versions:

capybara (1.1.2)
selenium-webdriver (2.15.0)
konacha (1.1.0)

this is how i run it:

bundle exec rake konacha:run --trace

what else might help?

Collaborator

joliss commented Apr 18, 2012

That's basically the same as my setup. Let's see:

Does it happen on your system with a fresh Rails app? Just run rails new, add Konacha, and add a single empty test to see if it works.

If fresh Rails apps work OK, can you gut your problematic app (successively removing all parts of it) until you isolate or narrow down the cause of the issue?

If you push your gutted app or email it to John and/or me, we might be able to help debug as well.

Regarding the error message you are getting, I'm not sure it's actually a double-escaping issue, by the way. The string-with-backslashes thing might just be the formatting of the stack trace. But in any case it's worth getting to the bottom of it.

trak3r commented Apr 19, 2012

apologies for the delay. i hope to attempt your suggestion soon.

Collaborator

joliss commented Apr 19, 2012

Thanks -- no hurry :)

Collaborator

joliss commented Apr 25, 2012

Any update on what happened to this?

trak3r commented Apr 25, 2012

my apologies i'll not be able to get to it this week. you're welcome to close the issue and i can re-open it once i'm able to reproduce it with an isolated project.

@jfirebaugh jfirebaugh closed this May 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment