开发者

Cucumber @javascript Breaks Oracle SQL Calls

开发者 https://www.devze.com 2023-03-23 08:46 出处:网络
I am using Ruby on Rails 3.0.7 Cucumber 1.0.1, and Oracle as the database. I have my own local user/schema for my development database, but I also connect to another Oracle database in a read-only fas

I am using Ruby on Rails 3.0.7 Cucumber 1.0.1, and Oracle as the database. I have my own local user/schema for my development database, but I also connect to another Oracle database in a read-only fashion. Someone as my work has created a gem that allows me to talk to that other database and access its models. Let's say we call that other database Servo. Then I am able to do something like Servo::ModelName.all and all other regular calls.

The Oracle that gets generated by that is something like: SELECT * FROM "SERVO"."MODELNAMES"; Note that it appends the SERVO database name.

Now, I am writing a Cucumber test that at times, in my custom steps, uses Servo. That all works fine. The new scenario I am writing uses the @javascript tag. If any step (in the Background or in the Scenario) does not use Servo, then it runs fine. However, if I do use Servo, it breaks. The Oracle SQL being generated is suddenly SELECT * FROM "MODELNAMES"; and it is no longer aware of the other database.

So, any ideas why this is happening? Why does the @javascript suddenly change the SQL being generated? I couldn't find any good documentation about what else it does besides launching Firefox.

I'm sure others may want to know more information开发者_StackOverflow社区 but I didn't want to flood this question so just let me know if you want some more details.


The main difference @javascript will introduce on the application side is that you're running a web server instead of routing requests directly through rack. I'd investigate with that knowledge and see if there isn't something you're doing in an initializer or something which could be affected by the different context.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号