Re: [Rails] getting values from another table...

2017-02-10 Thread Joe Guerra
I"m building a basic cart system, one item per cart. I'm still trying to learn ruby on rails. Thanks, Jo On Thursday, February 9, 2017 at 10:44:09 PM UTC-5, Hassan Schroeder wrote: > > On Thu, Feb 9, 2017 at 5:55 PM, Joe Guerra > wrote: > > > Are you suggesting I nest my product loop in my

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 3:43:00 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 14:29, 'krfg' via Ruby on Rails: Talk > > wrote: > > ... > > Then the problem was just rendering the home page after invalid > submission > > instead of redirecting to the home page. > > The original

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 14:29, 'krfg' via Ruby on Rails: Talk wrote: > ... > Then the problem was just rendering the home page after invalid submission > instead of redirecting to the home page. > The original code was render 'static_pages/home', you can check it here. > This original code would sh

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 2:58:48 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 13:46, 'krfg' via Ruby on Rails: Talk > > wrote: > > ... > > The home page is controlled by static_pages_controller.rb > > However the part of the home page concerning microposts creation and > > d

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 14:19, Hassan Schroeder wrote: > On Fri, Feb 10, 2017 at 3:02 AM, 'krfg' via Ruby on Rails: Talk > wrote: > >> The AtpCalendar and WtaCalendar fixtures are empty. >> Therefore, any? should return an empty array > > 1. If your test depends on some values being populated, the

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Hassan Schroeder
On Fri, Feb 10, 2017 at 3:02 AM, 'krfg' via Ruby on Rails: Talk wrote: > The AtpCalendar and WtaCalendar fixtures are empty. > Therefore, any? should return an empty array 1. If your test depends on some values being populated, then you need to provide that through fixtures or factories. 2.

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 13:46, 'krfg' via Ruby on Rails: Talk wrote: > ... > The home page is controlled by static_pages_controller.rb > However the part of the home page concerning microposts creation and > deletion is controlled by the microposts controller. > Below is an extract of microposts_c

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
> > > The home page is controlled by static_pages_controller.rb > However the part of the home page concerning microposts creation and > deletion is controlled by the microposts controller. > Below is an extract of microposts_controller.rb > > class MicropostsController < ApplicationController >

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 2:32:49 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 12:44, 'krfg' via Ruby on Rails: Talk > > wrote: > > ... > > As you suggested I inserted logger.info immediately after the > declaration of > > @atp_tournaments in static_pages_controller.rb: > > >

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 12:44, 'krfg' via Ruby on Rails: Talk wrote: > ... > As you suggested I inserted logger.info immediately after the declaration of > @atp_tournaments in static_pages_controller.rb: > > def home > if logged_in? && !current_user.gamer? > ... > elsif lo

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 1:25:37 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 12:16, 'krfg' via Ruby on Rails: Talk > > wrote: > > > > Ok, thanks for the suggestion. > > I will try to use tail if it works with such a heavy file, otherwise I > would > > need instructions on how

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 1:25:37 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 12:16, 'krfg' via Ruby on Rails: Talk > > wrote: > > > > Ok, thanks for the suggestion. > > I will try to use tail if it works with such a heavy file, otherwise I > would > > need instructions on how

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 12:16, 'krfg' via Ruby on Rails: Talk wrote: > > I will try to use tail if it works with such a heavy file, otherwise I would > need instructions on how to empty the file. echo "" > log/test.log but probably you can just delete it rm log/test.log Colin -- You received th

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 12:16, 'krfg' via Ruby on Rails: Talk wrote: > > Ok, thanks for the suggestion. > I will try to use tail if it works with such a heavy file, otherwise I would > need instructions on how to empty the file. > The most important thing I have to understand is: where should I pla

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 1:05:57 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 11:50, 'krfg' via Ruby on Rails: Talk > > wrote: > > > > I would need information about logger.info > > When I try to open test.log Atom warns me that if it opens large files > it > > might become un

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 11:50, 'krfg' via Ruby on Rails: Talk wrote: > > I would need information about logger.info > When I try to open test.log Atom warns me that if it opens large files it > might become unresponsive. > Shall I take for granted that you are interested it test.log? Whichever log

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 12:50:19 PM UTC+1, krfg wrote: > > > > On Friday, February 10, 2017 at 12:31:17 PM UTC+1, Colin Law wrote: >> >> On 10 February 2017 at 11:02, 'krfg' via Ruby on Rails: Talk >> wrote: >> > In app/controllers/static_pages_controller.rb the following variables >>

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
On Friday, February 10, 2017 at 12:31:17 PM UTC+1, Colin Law wrote: > > On 10 February 2017 at 11:02, 'krfg' via Ruby on Rails: Talk > > wrote: > > In app/controllers/static_pages_controller.rb the following variables > (among > > others) are defined: > > > > def home > > if logg

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 11:02, 'krfg' via Ruby on Rails: Talk wrote: > In app/controllers/static_pages_controller.rb the following variables (among > others) are defined: > > def home > if logged_in? && !current_user.gamer? > ... > elsif logged_in? && current_user.gamer? >

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
In app/controllers/static_pages_ controller.rb the following variables (among others) are defined: def home if logged_in? && !current_user.gamer? ... elsif logged_in? && current_user.gamer? ... @week_num = Time.now.strftime("%W").to_i @atp

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
In app/controllers/static_pages_controller.rb the following variables (among others) are defined: def home if logged_in? && !current_user.gamer? ... elsif logged_in? && current_user.gamer? ... @week_num = Time.now.strftime("%W").to_i

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
Below is what the console is reporting when I run the test. As you can notice, the test raises one error: method any? on nil class (the instance variable @atp_tournaments of the code in my first post). If I change this instance variable with its explicit value, the next error is of next method on

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 10:34, 'krfg' via Ruby on Rails: Talk wrote: > You can have a look at the partial _social_layer.html.erb at this link: it > is the code included in the if statement. > As I said, I changed my homepage as follows: > > <% if logged_in? %> > <% if current_user.gamer? %> >

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 10:23, 'krfg' via Ruby on Rails: Talk wrote: > Only the test, the application works as expected. > I thought the problem might be that there are too many nested partials in > the homepage, but apart from that I have no idea why the test fails Please remember to quote the pr

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
You can have a look at the partial _social_layer.html.erb at this link : it is the code included in the if statement. As I said, I changed my homepage as follows: <% if logged_in? %> <% if current_user.gamer? %>

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
Only the test, the application works as expected. I thought the problem might be that there are too many nested partials in the homepage, but apart from that I have no idea why the test fails -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" grou

Re: [Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread Colin Law
On 10 February 2017 at 09:16, 'krfg' via Ruby on Rails: Talk wrote: > Once I completed Michael Hartl's tutorial, I packed my homepage in a partial > and called it _social_layer.html.erb > Then I inserted this partial in my new homepage and proceeded to develop my > application. > Therefore, an ext

[Rails] Re: What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
NOTE: I did not inserted any link on 'tournament.name' but it keeps coming out of nowhere automatically. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
Once I completed Michael Hartl's tutorial, I packed my homepage in a partial and called it _social_layer.html.erb Then I inserted this partial in my new homepage and proceeded to develop my application. Therefore, an extract of application's new homepage looks like as follows: <%

[Rails] What can prevent an integration test from loading instance variables?

2017-02-10 Thread 'krfg' via Ruby on Rails: Talk
Once I completed Michael Hartl's tutorial, I packed my homepage in a partial and called it _social_layer.html.erb Then I inserted this partial in my new homepage and proceeded to develop my application. Therefore, an extract of application's new homepage looks like as follows: <%