Page 1 of 1
[15:05:01] fluffykat: hello - can someone tell me how i can test if a variable returns a random number from 0-2 in capybara?
[15:11:15] fluffykat: hmm, is that code actually testing for randomnes though jhass ? If variable is always =1 then the test would still always pass, despite not setting variable to a random number between 0-2
[00:47:07] fluffykat: web interface is ok... what would be great is if i could connect to slack using an irc client like hexchat or something
[21:03:20] fluffykat: hi - how can i use capybara to check if an item is placed in the correct position inside a list (i.e. inside 'ul#list'?
[21:14:17] fluffykat: jhass: when i replace ".to" with ".should" in your suggestion the code works...
[21:22:33] fluffykat: when i use '.to' i get the following error : undefined method `to' for #<Capybara::Element tag="li" path="/html/body/ul/li">
[13:02:25] fluffykat: hello - I am hoping someone can help. I can't get my basic if statement to work.
[13:15:36] fluffykat: i'm checking if type_a has picked 5 and type_b has picked 2 in the first test and if so then type_a wins. the method .pick returns the string '5' or '2'
[13:17:51] fluffykat: is this the correct expression? - if ((self.type_a.pick('5')) == '5') && (self.type_b.pick('2') == '2')
[13:41:24] fluffykat: I've tested it in irb and what is happening is this: when i define type_a.pick = '5' and type_b.pick = '2' then Irb works fine when I check what value type_a is and value type_b is. As soon as I run the program, the type_b changes its value?? bizarre
[13:58:19] fluffykat: [k-: apologises - I was distracted from the screen. I think I understand what explain the error. Let me paste the irb as requested...give me a moment please.
[14:06:44] fluffykat: [k-: I've fixed my problem. I couldn't resist making the change in the code and seeing if it worked in IRB. Basically the error is in this line " if (self.type_a.pick('5')) && self.type_b.pick('2')" . When it reaches this line it changes type_b to the value 2 even if I had previously assigned the value '5' to it. I had to instead save the value in a method that doesn't ask for any arguments. the code now works