fluffykat

Activity Graph

Page 1 of 1

2015-08-30

[08:24:51] fluffykat: has joined #ruby
[10:51:30] fluffykat: has left #ruby: ("Leaving")

2015-08-26

[15:04:18] fluffykat: has joined #ruby
[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
[15:21:11] fluffykat: jhass: your code is good enough. Thanks
[16:41:49] fluffykat: Ping timeout: 264 seconds
[19:07:36] fluffykat: has joined #ruby
[19:11:49] fluffykat: has left #ruby: ()

2015-08-17

[00:43:57] fluffykat: it supports irc?
[00:45:48] fluffykat: problem is no linux app
[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
[00:54:58] fluffykat: Remote host closed the connection

2015-08-16

[21:00:02] fluffykat: has joined #ruby
[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:05:20] fluffykat: you're a genius thanks
[21:14:17] fluffykat: jhass: when i replace ".to" with ".should" in your suggestion the code works...
[21:21:13] fluffykat: jhass: I get a deprecation warning about using 'should'
[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[1]">
[21:24:26] fluffykat: expect(find("ul#list > li:nth-child(1)").to have_text("test message"))
[21:24:39] fluffykat: thats my code
[21:26:24] fluffykat: yeah, my bad...i missed it.
[21:26:35] fluffykat: it works now. cheers

2015-08-09

[13:01:07] fluffykat: has joined #ruby
[13:02:25] fluffykat: hello - I am hoping someone can help. I can't get my basic if statement to work.
[13:02:35] fluffykat: I'll paste code to gist
[13:04:22] fluffykat: http://pastebin.com/Wnk1HwyD
[13:05:56] fluffykat: basically it's always returning type_a.name as the winner.....
[13:07:57] fluffykat: yeah, i'll take out those brackets and see if it makes a difference
[13:09:19] fluffykat: hmm...im checking in irb
[13:09:33] fluffykat: it return '5'
[13:10:16] fluffykat: `self.type_a.pick('2')` returns '2'
[13:11:16] fluffykat: just learning
[13:13:03] fluffykat: basically if i enter test.type_a.pick('5') it returns '5', which is correct
[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:16:00] fluffykat: sorry the method pick returns the argument value passed into it
[13:17:51] fluffykat: is this the correct expression? - if ((self.type_a.pick('5')) == '5') && (self.type_b.pick('2') == '2')
[13:18:36] fluffykat: let me check
[13:38:12] fluffykat: hmm, the code is still not working
[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:42:25] fluffykat: as soon as i run test.play i meant to say*
[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
[14:52:17] fluffykat: Quit: Leaving