I''m following this tutorial: http://railstutorial.org/chapters/static-pages#sec:red And have passed the tests that confirm that every pages has the relevant title. When I run the application I always get the title bar as "SampleApp", although I have the views with different title as shown in the attachment. I was going to show the code using http://pastie.org/, but the site was down at the time of this question. Attachments: http://www.ruby-forum.com/attachment/4920/pages.zip -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
This worked when I modified application.html.erb as shown in the attachment, as it had the title as "SampleApp" Attachments: http://www.ruby-forum.com/attachment/4921/application.html.erb -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 7 August 2010 23:23, Abder-Rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> This worked when I modified application.html.erb as shown in the > attachment, as it had the title as "SampleApp"How was it that your tests worked then? It is important when writing tests to write them before the code. Your tests on the title should therefore have failed initially (as you had not yet supplied the title). This helps to guard against errors in the test code not actually testing what you intended, as I presume was the case here. Colin> > Attachments: > http://www.ruby-forum.com/attachment/4921/application.html.erb > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law wrote:> On 7 August 2010 23:23, Abder-Rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> This worked when I modified application.html.erb as shown in the >> attachment, as it had the title as "SampleApp" > > How was it that your tests worked then? It is important when writing > tests to write them before the code. Your tests on the title should > therefore have failed initially (as you had not yet supplied the > title). This helps to guard against errors in the test code not > actually testing what you intended, as I presume was the case here. > > ColinI actually wrote the tests before, and have provided the titles, but the strange thing was that I was always getting "SampleApp" as the title. So, the tests passes since the titles were in every page I made a test for. In order to remove the "SampleApp" title, I had to modify application.html.erb. This is what happened. What do you think? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 8 August 2010 10:56, Abder-Rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote: >> On 7 August 2010 23:23, Abder-Rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> This worked when I modified application.html.erb as shown in the >>> attachment, as it had the title as "SampleApp" >> >> How was it that your tests worked then? It is important when writing >> tests to write them before the code. Your tests on the title should >> therefore have failed initially (as you had not yet supplied the >> title). This helps to guard against errors in the test code not >> actually testing what you intended, as I presume was the case here. >> >> Colin > > I actually wrote the tests before, and have provided the titles, but the > strange thing was that I was always getting "SampleApp" as the title. > > So, the tests passes since the titles were in every page I made a test > for.I don''t understand, if all the titles were ''SampleApp'' how did the tests pass, since they presumably were checking for the correct titles? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.