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

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

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

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

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

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. >

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

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? &&

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 >

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 >

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

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

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

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

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

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: > > > >

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

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
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

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? %> >

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

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"

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

[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: