Hello, I am following the example in the Rspec book, starting page 372, where a controller''s create message is spec''d. it "creates a new message" do Message.should_receive(:new).with("text" => "a quick brown fox" ) post :create, :message => { "text" => "a quick brown fox" } end When i run this spec, the test is not being run and a ''Missing Template'' error is thrown. Failure/Error: post :create, :question => { "text" =>"a quick brown fox" } Missing template messages/create with {:locale=>[:en, :en], :handlers=>[:haml, :rjs, :builder, :rhtml, :erb, :rxml], :formats=>[:html]} in view paths "/myapps/app/views" I am using Rspec 2, Rails 3 and Haml. Did anybody else have this issue? Has something changed in the Rspec api, but it hasn''t been updated in the book? Thanks, -- Andrei Erdoss -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100427/5299e3fb/attachment.html>
David Chelimsky
2010-Apr-27 20:51 UTC
[rspec-users] Rspec 2 and Rails 3 - missing template
On Apr 27, 2010, at 3:46 PM, Andrei Erdoss wrote:> Hello, > > I am following the example in the Rspec book, starting page 372, where a controller''s create message is spec''d. > > it "creates a new message" do > Message.should_receive(:new).with("text" => "a quick brown fox" ) > post :create, :message => { "text" => "a quick brown fox" } > end > > When i run this spec, the test is not being run and a ''Missing Template'' error is thrown. > > Failure/Error: post :create, :question => { "text" =>"a quick brown fox" } > Missing template messages/create with {:locale=>[:en, :en], :handlers=>[:haml, :rjs, :builder, :rhtml, :erb, :rxml], :formats=>[:html]} in view paths "/myapps/app/views" > > > I am using Rspec 2, Rails 3 and Haml. > > Did anybody else have this issue? Has something changed in the Rspec api, but it hasn''t been updated in the book?The book has not been updated to Rails 3, nor does rspec-rails-2.0.0.beta.8 provide isolation from view templates. Please use the versions cited in the book as you go through the book. Cheers, Davidf
Thank you for the fast response. What''s the best way to handle the scenario described with Rails 3, Rspec 2? On Tue, Apr 27, 2010 at 4:51 PM, David Chelimsky <dchelimsky at gmail.com>wrote:> On Apr 27, 2010, at 3:46 PM, Andrei Erdoss wrote: > > > Hello, > > > > I am following the example in the Rspec book, starting page 372, where a > controller''s create message is spec''d. > > > > it "creates a new message" do > > Message.should_receive(:new).with("text" => "a quick brown > fox" ) > > post :create, :message => { "text" => "a quick brown fox" } > > end > > > > When i run this spec, the test is not being run and a ''Missing Template'' > error is thrown. > > > > Failure/Error: post :create, :question => { "text" =>"a quick brown fox" > } > > Missing template messages/create with {:locale=>[:en, :en], > :handlers=>[:haml, :rjs, :builder, :rhtml, :erb, :rxml], :formats=>[:html]} > in view paths "/myapps/app/views" > > > > > > I am using Rspec 2, Rails 3 and Haml. > > > > Did anybody else have this issue? Has something changed in the Rspec api, > but it hasn''t been updated in the book? > > The book has not been updated to Rails 3, nor does rspec-rails-2.0.0.beta.8 > provide isolation from view templates. > > Please use the versions cited in the book as you go through the book. > > Cheers, > Davidf > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Andrei Erdoss -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100427/850c0cee/attachment.html>
David Chelimsky
2010-Apr-27 21:12 UTC
[rspec-users] Rspec 2 and Rails 3 - missing template
On Tue, Apr 27, 2010 at 4:04 PM, Andrei Erdoss <erdoss at gmail.com> wrote:> Thank you for the fast response. What''s the best way to handle the scenario > described with Rails 3, Rspec 2?touch messages/create.html.haml :) Keep in mind that once rails 3 and rspec 2 go final, we''ll have this worked out. Everything''s still in beta (and in progress) right now.> > On Tue, Apr 27, 2010 at 4:51 PM, David Chelimsky <dchelimsky at gmail.com> > wrote: >> >> On Apr 27, 2010, at 3:46 PM, Andrei Erdoss wrote: >> >> > Hello, >> > >> > I am following the example in the Rspec book, starting page 372, where a >> > controller''s create message is spec''d. >> > >> > it "creates a new message" do >> > ? Message.should_receive(:new).with("text" ? ?=> ? ?"a ? ?quick ? ?brown >> > ? ?fox" ) >> > ? post :create, :message => { "text" => "a quick brown fox" } >> > end >> > >> > When i run this spec, the test is not being run and a ''Missing Template'' >> > error is thrown. >> > >> > Failure/Error: post :create, :question => { "text" =>"a quick brown fox" >> > } >> > ? ? Missing template messages/create with {:locale=>[:en, :en], >> > :handlers=>[:haml, :rjs, :builder, :rhtml, :erb, :rxml], :formats=>[:html]} >> > in view paths "/myapps/app/views" >> > >> > >> > I am using Rspec 2, Rails 3 and Haml. >> > >> > Did anybody else have this issue? Has something changed in the Rspec >> > api, but it hasn''t been updated in the book? >> >> The book has not been updated to Rails 3, nor does >> rspec-rails-2.0.0.beta.8 provide isolation from view templates. >> >> Please use the versions cited in the book as you go through the book. >> >> Cheers, >> Davidf >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > > > -- > Andrei Erdoss > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2010-Apr-27 21:12 UTC
[rspec-users] Rspec 2 and Rails 3 - missing template
On Tue, Apr 27, 2010 at 4:12 PM, David Chelimsky <dchelimsky at gmail.com> wrote:> On Tue, Apr 27, 2010 at 4:04 PM, Andrei Erdoss <erdoss at gmail.com> wrote: >> Thank you for the fast response. What''s the best way to handle the scenario >> described with Rails 3, Rspec 2? > > touch messages/create.html.haml :)or, rather: touch app/views/messages/create.html.haml> > Keep in mind that once rails 3 and rspec 2 go final, we''ll have this > worked out. Everything''s still in beta (and in progress) right now. > >> >> On Tue, Apr 27, 2010 at 4:51 PM, David Chelimsky <dchelimsky at gmail.com> >> wrote: >>> >>> On Apr 27, 2010, at 3:46 PM, Andrei Erdoss wrote: >>> >>> > Hello, >>> > >>> > I am following the example in the Rspec book, starting page 372, where a >>> > controller''s create message is spec''d. >>> > >>> > it "creates a new message" do >>> > ? Message.should_receive(:new).with("text" ? ?=> ? ?"a ? ?quick ? ?brown >>> > ? ?fox" ) >>> > ? post :create, :message => { "text" => "a quick brown fox" } >>> > end >>> > >>> > When i run this spec, the test is not being run and a ''Missing Template'' >>> > error is thrown. >>> > >>> > Failure/Error: post :create, :question => { "text" =>"a quick brown fox" >>> > } >>> > ? ? Missing template messages/create with {:locale=>[:en, :en], >>> > :handlers=>[:haml, :rjs, :builder, :rhtml, :erb, :rxml], :formats=>[:html]} >>> > in view paths "/myapps/app/views" >>> > >>> > >>> > I am using Rspec 2, Rails 3 and Haml. >>> > >>> > Did anybody else have this issue? Has something changed in the Rspec >>> > api, but it hasn''t been updated in the book? >>> >>> The book has not been updated to Rails 3, nor does >>> rspec-rails-2.0.0.beta.8 provide isolation from view templates. >>> >>> Please use the versions cited in the book as you go through the book. >>> >>> Cheers, >>> Davidf >>> >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >> >> >> >> -- >> Andrei Erdoss >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> >
Great! Thanks. Will Rspec 2 provide isolation from view templates or is this a design change? On Tue, Apr 27, 2010 at 5:12 PM, David Chelimsky <dchelimsky at gmail.com>wrote:> On Tue, Apr 27, 2010 at 4:12 PM, David Chelimsky <dchelimsky at gmail.com> > wrote: > > On Tue, Apr 27, 2010 at 4:04 PM, Andrei Erdoss <erdoss at gmail.com> wrote: > >> Thank you for the fast response. What''s the best way to handle the > scenario > >> described with Rails 3, Rspec 2? > > > > touch messages/create.html.haml :) > > or, rather: > > touch app/views/messages/create.html.haml > > > > > > Keep in mind that once rails 3 and rspec 2 go final, we''ll have this > > worked out. Everything''s still in beta (and in progress) right now. > > > >> > >> On Tue, Apr 27, 2010 at 4:51 PM, David Chelimsky <dchelimsky at gmail.com> > >> wrote: > >>> > >>> On Apr 27, 2010, at 3:46 PM, Andrei Erdoss wrote: > >>> > >>> > Hello, > >>> > > >>> > I am following the example in the Rspec book, starting page 372, > where a > >>> > controller''s create message is spec''d. > >>> > > >>> > it "creates a new message" do > >>> > Message.should_receive(:new).with("text" => "a quick > brown > >>> > fox" ) > >>> > post :create, :message => { "text" => "a quick brown fox" } > >>> > end > >>> > > >>> > When i run this spec, the test is not being run and a ''Missing > Template'' > >>> > error is thrown. > >>> > > >>> > Failure/Error: post :create, :question => { "text" =>"a quick brown > fox" > >>> > } > >>> > Missing template messages/create with {:locale=>[:en, :en], > >>> > :handlers=>[:haml, :rjs, :builder, :rhtml, :erb, :rxml], > :formats=>[:html]} > >>> > in view paths "/myapps/app/views" > >>> > > >>> > > >>> > I am using Rspec 2, Rails 3 and Haml. > >>> > > >>> > Did anybody else have this issue? Has something changed in the Rspec > >>> > api, but it hasn''t been updated in the book? > >>> > >>> The book has not been updated to Rails 3, nor does > >>> rspec-rails-2.0.0.beta.8 provide isolation from view templates. > >>> > >>> Please use the versions cited in the book as you go through the book. > >>> > >>> Cheers, > >>> Davidf > >>> > >>> _______________________________________________ > >>> rspec-users mailing list > >>> rspec-users at rubyforge.org > >>> http://rubyforge.org/mailman/listinfo/rspec-users > >> > >> > >> > >> -- > >> Andrei Erdoss > >> > >> _______________________________________________ > >> rspec-users mailing list > >> rspec-users at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/rspec-users > >> > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Andrei Erdoss -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100427/a10185c6/attachment.html>
David Chelimsky
2010-Apr-27 21:48 UTC
[rspec-users] Rspec 2 and Rails 3 - missing template
On Apr 27, 2010, at 4:25 PM, Andrei Erdoss wrote:> Great! Thanks. > > Will Rspec 2 provide isolation from view templates or is this a design change?There will be some sort of view isolation, but the jury is out on how it will work. I''m hopeful it will feel exactly like it does in rspec-rails-1.> > On Tue, Apr 27, 2010 at 5:12 PM, David Chelimsky <dchelimsky at gmail.com> wrote: > On Tue, Apr 27, 2010 at 4:12 PM, David Chelimsky <dchelimsky at gmail.com> wrote: > > On Tue, Apr 27, 2010 at 4:04 PM, Andrei Erdoss <erdoss at gmail.com> wrote: > >> Thank you for the fast response. What''s the best way to handle the scenario > >> described with Rails 3, Rspec 2? > > > > touch messages/create.html.haml :) > > or, rather: > > touch app/views/messages/create.html.haml > > > > > > Keep in mind that once rails 3 and rspec 2 go final, we''ll have this > > worked out. Everything''s still in beta (and in progress) right now. > > > >> > >> On Tue, Apr 27, 2010 at 4:51 PM, David Chelimsky <dchelimsky at gmail.com> > >> wrote: > >>> > >>> On Apr 27, 2010, at 3:46 PM, Andrei Erdoss wrote: > >>> > >>> > Hello, > >>> > > >>> > I am following the example in the Rspec book, starting page 372, where a > >>> > controller''s create message is spec''d. > >>> > > >>> > it "creates a new message" do > >>> > Message.should_receive(:new).with("text" => "a quick brown > >>> > fox" ) > >>> > post :create, :message => { "text" => "a quick brown fox" } > >>> > end > >>> > > >>> > When i run this spec, the test is not being run and a ''Missing Template'' > >>> > error is thrown. > >>> > > >>> > Failure/Error: post :create, :question => { "text" =>"a quick brown fox" > >>> > } > >>> > Missing template messages/create with {:locale=>[:en, :en], > >>> > :handlers=>[:haml, :rjs, :builder, :rhtml, :erb, :rxml], :formats=>[:html]} > >>> > in view paths "/myapps/app/views" > >>> > > >>> > > >>> > I am using Rspec 2, Rails 3 and Haml. > >>> > > >>> > Did anybody else have this issue? Has something changed in the Rspec > >>> > api, but it hasn''t been updated in the book? > >>> > >>> The book has not been updated to Rails 3, nor does > >>> rspec-rails-2.0.0.beta.8 provide isolation from view templates. > >>> > >>> Please use the versions cited in the book as you go through the book. > >>> > >>> Cheers, > >>> Davidf > >>> > >>> _______________________________________________ > >>> rspec-users mailing list > >>> rspec-users at rubyforge.org > >>> http://rubyforge.org/mailman/listinfo/rspec-users > >> > >> > >> > >> -- > >> Andrei Erdoss > >> > >> _______________________________________________ > >> rspec-users mailing list > >> rspec-users at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/rspec-users > >> > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > > > > -- > Andrei Erdoss > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100427/28fa827d/attachment.html>