Hello, I also tried testing for the flash notice being set, but it''s not working. it "sets a flash[:notice] message" do post :create flash[:notice].should == "The message was saved successfully." end this is the line in the controller that''s setting the notice. redirect_to messages_path, :notice => "The message was saved successfully." Anybody have some insight on this? -- Andrei Erdoss -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100427/cbd0d212/attachment.html>
On Apr 27, 2010, at 4:48 PM, Andrei Erdoss wrote:> Hello, > > I also tried testing for the flash notice being set, but it''s not working. > > it "sets a flash[:notice] message" do > post :create > flash[:notice].should == "The message was saved successfully." > end > > this is the line in the controller that''s setting the notice. > > redirect_to messages_path, :notice => "The message was saved successfully." > > Anybody have some insight on this?Are you using rspec-rails-2.0.0.beta.8?
I am using this line in my Gemfile: gem "rspec-rails", :git => "git:// github.com/rspec/rspec-rails.git" which installs the rspec-rails-2.0.0.beta.7 I tried beta.8 but I get an error: Rspec is not missing constant Matchers! (ArgumentError) On Tue, Apr 27, 2010 at 5:59 PM, David Chelimsky <dchelimsky at gmail.com>wrote:> On Apr 27, 2010, at 4:48 PM, Andrei Erdoss wrote: > > > Hello, > > > > I also tried testing for the flash notice being set, but it''s not > working. > > > > it "sets a flash[:notice] message" do > > post :create > > flash[:notice].should == "The message was saved successfully." > > end > > > > this is the line in the controller that''s setting the notice. > > > > redirect_to messages_path, :notice => "The message was saved > successfully." > > > > Anybody have some insight on this? > > Are you using rspec-rails-2.0.0.beta.8? > _______________________________________________ > 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/ac486b2a/attachment.html>
On Apr 27, 2010, at 9:19 PM, Andrei Erdoss wrote:> I am using this line in my Gemfile: gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git" > > which installs the rspec-rails-2.0.0.beta.7I released beta.8 yesterday, so if you "bundle install" you should get the update. I just changed controller specs to pull in behavior from rails'' functional tests (AC::TestCase) on Sunday in the source code, and released it just this morning. Anything before that would not have supported spec''ing flash messages> I tried beta.8 but I get an error: Rspec is not missing constant Matchers! (ArgumentError)There is a ticket on this: http://github.com/rspec/rspec-rails/issues#issue/12 Unfortunately, I''ve not been able to reproduce it yet.> On Tue, Apr 27, 2010 at 5:59 PM, David Chelimsky <dchelimsky at gmail.com> wrote: > On Apr 27, 2010, at 4:48 PM, Andrei Erdoss wrote: > > > Hello, > > > > I also tried testing for the flash notice being set, but it''s not working. > > > > it "sets a flash[:notice] message" do > > post :create > > flash[:notice].should == "The message was saved successfully." > > end > > > > this is the line in the controller that''s setting the notice. > > > > redirect_to messages_path, :notice => "The message was saved successfully." > > > > Anybody have some insight on this? > > Are you using rspec-rails-2.0.0.beta.8? > _______________________________________________ > 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/20100428/0d754a44/attachment-0001.html>
The flash notice test is not working in 2.0.0.beta.8. I tried it with redirect_to messages_path, :notice => "message" or redirect_to messages_path, :flash => {:notice => "message" } On Wed, Apr 28, 2010 at 1:08 AM, David Chelimsky <dchelimsky at gmail.com>wrote:> On Apr 27, 2010, at 9:19 PM, Andrei Erdoss wrote: > > I am using this line in my Gemfile: gem "rspec-rails", :git => "git:// > github.com/rspec/rspec-rails.git" > > which installs the rspec-rails-2.0.0.beta.7 > > > I released beta.8 yesterday, so if you "bundle install" you should get the > update. I just changed controller specs to pull in behavior from rails'' > functional tests (AC::TestCase) on Sunday in the source code, and released > it just this morning. Anything before that would not have supported spec''ing > flash messages > > I tried beta.8 but I get an error: Rspec is not missing constant Matchers! > (ArgumentError) > > > There is a ticket on this: > http://github.com/rspec/rspec-rails/issues#issue/12 > > Unfortunately, I''ve not been able to reproduce it yet. >This happens when specifying directly the gem version in the gem file. gem ''rspec-rails'', ''>= 2.0.0.beta.8''> > On Tue, Apr 27, 2010 at 5:59 PM, David Chelimsky <dchelimsky at gmail.com>wrote: > >> On Apr 27, 2010, at 4:48 PM, Andrei Erdoss wrote: >> >> > Hello, >> > >> > I also tried testing for the flash notice being set, but it''s not >> working. >> > >> > it "sets a flash[:notice] message" do >> > post :create >> > flash[:notice].should == "The message was saved successfully." >> > end >> > >> > this is the line in the controller that''s setting the notice. >> > >> > redirect_to messages_path, :notice => "The message was saved >> successfully." >> > > >> > Anybody have some insight on this? >> >> Are you using rspec-rails-2.0.0.beta.8? >> _______________________________________________ >> 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/20100428/9395e9c3/attachment.html>
On Apr 28, 2010, at 9:01 AM, Andrei Erdoss wrote:> The flash notice test is not working in 2.0.0.beta.8. I tried it with redirect_to messages_path, :notice => "message" or redirect_to messages_path, :flash => {:notice => "message" }Please add an issue for this: http://github.com/rspec/rspec-rails/issues Thx> > On Wed, Apr 28, 2010 at 1:08 AM, David Chelimsky <dchelimsky at gmail.com> wrote: > On Apr 27, 2010, at 9:19 PM, Andrei Erdoss wrote: > >> I am using this line in my Gemfile: gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git" >> >> which installs the rspec-rails-2.0.0.beta.7 > > I released beta.8 yesterday, so if you "bundle install" you should get the update. I just changed controller specs to pull in behavior from rails'' functional tests (AC::TestCase) on Sunday in the source code, and released it just this morning. Anything before that would not have supported spec''ing flash messages > >> I tried beta.8 but I get an error: Rspec is not missing constant Matchers! (ArgumentError) > > There is a ticket on this: http://github.com/rspec/rspec-rails/issues#issue/12 > > Unfortunately, I''ve not been able to reproduce it yet. > > This happens when specifying directly the gem version in the gem file. gem ''rspec-rails'', ''>= 2.0.0.beta.8'' > >> On Tue, Apr 27, 2010 at 5:59 PM, David Chelimsky <dchelimsky at gmail.com> wrote: >> On Apr 27, 2010, at 4:48 PM, Andrei Erdoss wrote: >> >> > Hello, >> > >> > I also tried testing for the flash notice being set, but it''s not working. >> > >> > it "sets a flash[:notice] message" do >> > post :create >> > flash[:notice].should == "The message was saved successfully." >> > end >> > >> > this is the line in the controller that''s setting the notice. >> > >> > redirect_to messages_path, :notice => "The message was saved successfully." >> > >> > Anybody have some insight on this? >> >> Are you using rspec-rails-2.0.0.beta.8? >> _______________________________________________ >> 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/20100428/b028984d/attachment-0001.html>
My mistake. I left out a very important piece of the spec. @message.stub(:save).and_return(true) Everything is working fine. Thanks for your help. On Wed, Apr 28, 2010 at 2:03 PM, David Chelimsky <dchelimsky at gmail.com>wrote:> On Apr 28, 2010, at 9:01 AM, Andrei Erdoss wrote: > > The flash notice test is not working in 2.0.0.beta.8. I tried it with > redirect_to messages_path, :notice => "message" or redirect_to > messages_path, :flash => {:notice => "message" } > > > Please add an issue for this: > > http://github.com/rspec/rspec-rails/issues > > Thx > > > On Wed, Apr 28, 2010 at 1:08 AM, David Chelimsky <dchelimsky at gmail.com>wrote: > >> On Apr 27, 2010, at 9:19 PM, Andrei Erdoss wrote: >> >> I am using this line in my Gemfile: gem "rspec-rails", :git => "git:// >> github.com/rspec/rspec-rails.git" >> >> which installs the rspec-rails-2.0.0.beta.7 >> >> >> I released beta.8 yesterday, so if you "bundle install" you should get the >> update. I just changed controller specs to pull in behavior from rails'' >> functional tests (AC::TestCase) on Sunday in the source code, and released >> it just this morning. Anything before that would not have supported spec''ing >> flash messages >> >> I tried beta.8 but I get an error: Rspec is not missing constant Matchers! >> (ArgumentError) >> >> >> There is a ticket on this: >> http://github.com/rspec/rspec-rails/issues#issue/12 >> >> Unfortunately, I''ve not been able to reproduce it yet. >> > > This happens when specifying directly the gem version in the gem file. gem > ''rspec-rails'', ''>= 2.0.0.beta.8'' > >> >> On Tue, Apr 27, 2010 at 5:59 PM, David Chelimsky <dchelimsky at gmail.com>wrote: >> >>> On Apr 27, 2010, at 4:48 PM, Andrei Erdoss wrote: >>> >>> > Hello, >>> > >>> > I also tried testing for the flash notice being set, but it''s not >>> working. >>> > >>> > it "sets a flash[:notice] message" do >>> > post :create >>> > flash[:notice].should == "The message was saved successfully." >>> > end >>> > >>> > this is the line in the controller that''s setting the notice. >>> > >>> > redirect_to messages_path, :notice => "The message was saved >>> successfully." >>> >> > >>> > Anybody have some insight on this? >>> >>> Are you using rspec-rails-2.0.0.beta.8? >>> _______________________________________________ >>> 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 > > > > _______________________________________________ > 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/20100429/6d956953/attachment.html>