Lance Carlson
2007-Aug-08 14:26 UTC
[rspec-users] Problems with RESTfully generated helpers
I am using helper the RESTfully generated helper methods in my views. My routes are nested so the helpers appear to need arguments passed to them, but it works without arguments. Say for example I have pages and comments. If I do page_comments_path without parameters, it works. However, when I run the rspec test, it fails and tells me i''m missing parameters. I tried to pass params[:page_id], but it still says it needs parameters. I did fill in the parameters like it asked and the test passed, but I think my views look cleaner without the arguments being passed everywhere. Do I have to stub these methods to get my views to pass, or is there some other way? TIA, Lance
David Chelimsky
2007-Aug-08 15:07 UTC
[rspec-users] Problems with RESTfully generated helpers
On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote:> I am using helper the RESTfully generated helper methods in my views. > My routes are nested so the helpers appear to need arguments passed to > them, but it works without arguments. Say for example I have pages and > comments. If I do page_comments_path without parameters, it works. > However, when I run the rspec test, it fails and tells me i''m missing > parameters. I tried to pass params[:page_id], but it still says it > needs parameters. I did fill in the parameters like it asked and the > test passed, but I think my views look cleaner without the arguments > being passed everywhere. Do I have to stub these methods to get my > views to pass, or is there some other way?It would be much easier to answer your question if you posted the actual spec and code.> > TIA, > Lance > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Lance Carlson
2007-Aug-08 15:56 UTC
[rspec-users] Problems with RESTfully generated helpers
ActionView::TemplateError in ''Edit Artist Page should render the edit artist form'' label_artist_url failed to generate from {:controller=>"artists", :action=>"show"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["labels", :label_id, "artists", :id] - are they all satisfied? On line #3 of app/views/artists/edit.rhtml 1: <h1>Editing artist</h1> 2: 3: <% form_tag label_artist_path, :method => :put do %> 4: <%= render :partial => ''form'' %> 5: <%= submit_tag ''Save'' %> 6: <% end %> My spec looks like: require File.dirname(__FILE__) + ''/../../spec_helper'' describe ''Edit Artist Page'' do before do @label = mock_model(Label) @artist = mock_model(Artist) assigns[:label] = @label assigns[:artist] = @artist end def render_edit render :template => ''artists/edit'' end it "should render the edit artist form" do render_edit end end On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > I am using helper the RESTfully generated helper methods in my views. > > My routes are nested so the helpers appear to need arguments passed to > > them, but it works without arguments. Say for example I have pages and > > comments. If I do page_comments_path without parameters, it works. > > However, when I run the rspec test, it fails and tells me i''m missing > > parameters. I tried to pass params[:page_id], but it still says it > > needs parameters. I did fill in the parameters like it asked and the > > test passed, but I think my views look cleaner without the arguments > > being passed everywhere. Do I have to stub these methods to get my > > views to pass, or is there some other way? > > It would be much easier to answer your question if you posted the > actual spec and code. > > > > > TIA, > > Lance > > _______________________________________________ > > 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 >
Lance Carlson
2007-Aug-08 17:50 UTC
[rspec-users] Problems with RESTfully generated helpers
I just passed label_artist_path(@label.id, @artist.id) into the view and it worked.. but I really don''t want to have to pass those parameters in all my views. It looks ugly. Does anyone know a way around this without stubbing? It seems useless to test this view without allowing those methods to act out their real behavior. -TIA On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote:> ActionView::TemplateError in ''Edit Artist Page should render the edit > artist form'' > label_artist_url failed to generate from {:controller=>"artists", > :action=>"show"} - you may have ambiguous routes, or you may need to > supply additional parameters for this route. content_url has the > following required parameters: ["labels", :label_id, "artists", :id] - > are they all satisfied? > On line #3 of app/views/artists/edit.rhtml > > 1: <h1>Editing artist</h1> > 2: > 3: <% form_tag label_artist_path, :method => :put do %> > 4: <%= render :partial => ''form'' %> > 5: <%= submit_tag ''Save'' %> > 6: <% end %> > > > My spec looks like: > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > describe ''Edit Artist Page'' do > before do > @label = mock_model(Label) > @artist = mock_model(Artist) > > assigns[:label] = @label > assigns[:artist] = @artist > end > > def render_edit > render :template => ''artists/edit'' > end > > it "should render the edit artist form" do > render_edit > end > end > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > I am using helper the RESTfully generated helper methods in my views. > > > My routes are nested so the helpers appear to need arguments passed to > > > them, but it works without arguments. Say for example I have pages and > > > comments. If I do page_comments_path without parameters, it works. > > > However, when I run the rspec test, it fails and tells me i''m missing > > > parameters. I tried to pass params[:page_id], but it still says it > > > needs parameters. I did fill in the parameters like it asked and the > > > test passed, but I think my views look cleaner without the arguments > > > being passed everywhere. Do I have to stub these methods to get my > > > views to pass, or is there some other way? > > > > It would be much easier to answer your question if you posted the > > actual spec and code. > > > > > > > > TIA, > > > Lance > > > _______________________________________________ > > > 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 > > >
David Chelimsky
2007-Aug-08 18:30 UTC
[rspec-users] Problems with RESTfully generated helpers
On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote:> I just passed label_artist_path(@label.id, @artist.id) into the view > and it worked.. but I really don''t want to have to pass those > parameters in all my views. It looks ugly. Does anyone know a way > around this without stubbing? It seems useless to test this view > without allowing those methods to act out their real behavior.Can you point me to docs that say you''re supposed to be able to just call label_artist_path without any args? I''ve not see such docs and I can''t get it to work in any of my views - and I''m talking about just rendering the views at all, not getting specs to work.> > -TIA > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > ActionView::TemplateError in ''Edit Artist Page should render the edit > > artist form'' > > label_artist_url failed to generate from {:controller=>"artists", > > :action=>"show"} - you may have ambiguous routes, or you may need to > > supply additional parameters for this route. content_url has the > > following required parameters: ["labels", :label_id, "artists", :id] - > > are they all satisfied? > > On line #3 of app/views/artists/edit.rhtml > > > > 1: <h1>Editing artist</h1> > > 2: > > 3: <% form_tag label_artist_path, :method => :put do %> > > 4: <%= render :partial => ''form'' %> > > 5: <%= submit_tag ''Save'' %> > > 6: <% end %> > > > > > > My spec looks like: > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > describe ''Edit Artist Page'' do > > before do > > @label = mock_model(Label) > > @artist = mock_model(Artist) > > > > assigns[:label] = @label > > assigns[:artist] = @artist > > end > > > > def render_edit > > render :template => ''artists/edit'' > > end > > > > it "should render the edit artist form" do > > render_edit > > end > > end > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > I am using helper the RESTfully generated helper methods in my views. > > > > My routes are nested so the helpers appear to need arguments passed to > > > > them, but it works without arguments. Say for example I have pages and > > > > comments. If I do page_comments_path without parameters, it works. > > > > However, when I run the rspec test, it fails and tells me i''m missing > > > > parameters. I tried to pass params[:page_id], but it still says it > > > > needs parameters. I did fill in the parameters like it asked and the > > > > test passed, but I think my views look cleaner without the arguments > > > > being passed everywhere. Do I have to stub these methods to get my > > > > views to pass, or is there some other way? > > > > > > It would be much easier to answer your question if you posted the > > > actual spec and code. > > > > > > > > > > > TIA, > > > > Lance > > > > _______________________________________________ > > > > 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 > > > > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Lance Carlson
2007-Aug-08 18:38 UTC
[rspec-users] Problems with RESTfully generated helpers
All I''m doing is passing the instance variables @label and @artist in the controller to the view using this code: @label = current_user.labels.find(params[:label_id]) @artist = params[:id].nil? ? Artist.new : @label.artists.find(params[:id]) By sending these two instance variables to the view, I don''t need to specify these arguments and the view just works. Can you get it to work when you specify these instance variables in your controller? -L On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > I just passed label_artist_path(@label.id, @artist.id) into the view > > and it worked.. but I really don''t want to have to pass those > > parameters in all my views. It looks ugly. Does anyone know a way > > around this without stubbing? It seems useless to test this view > > without allowing those methods to act out their real behavior. > > Can you point me to docs that say you''re supposed to be able to just > call label_artist_path without any args? I''ve not see such docs and I > can''t get it to work in any of my views - and I''m talking about just > rendering the views at all, not getting specs to work. > > > > > -TIA > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > ActionView::TemplateError in ''Edit Artist Page should render the edit > > > artist form'' > > > label_artist_url failed to generate from {:controller=>"artists", > > > :action=>"show"} - you may have ambiguous routes, or you may need to > > > supply additional parameters for this route. content_url has the > > > following required parameters: ["labels", :label_id, "artists", :id] - > > > are they all satisfied? > > > On line #3 of app/views/artists/edit.rhtml > > > > > > 1: <h1>Editing artist</h1> > > > 2: > > > 3: <% form_tag label_artist_path, :method => :put do %> > > > 4: <%= render :partial => ''form'' %> > > > 5: <%= submit_tag ''Save'' %> > > > 6: <% end %> > > > > > > > > > My spec looks like: > > > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > > > describe ''Edit Artist Page'' do > > > before do > > > @label = mock_model(Label) > > > @artist = mock_model(Artist) > > > > > > assigns[:label] = @label > > > assigns[:artist] = @artist > > > end > > > > > > def render_edit > > > render :template => ''artists/edit'' > > > end > > > > > > it "should render the edit artist form" do > > > render_edit > > > end > > > end > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > I am using helper the RESTfully generated helper methods in my views. > > > > > My routes are nested so the helpers appear to need arguments passed to > > > > > them, but it works without arguments. Say for example I have pages and > > > > > comments. If I do page_comments_path without parameters, it works. > > > > > However, when I run the rspec test, it fails and tells me i''m missing > > > > > parameters. I tried to pass params[:page_id], but it still says it > > > > > needs parameters. I did fill in the parameters like it asked and the > > > > > test passed, but I think my views look cleaner without the arguments > > > > > being passed everywhere. Do I have to stub these methods to get my > > > > > views to pass, or is there some other way? > > > > > > > > It would be much easier to answer your question if you posted the > > > > actual spec and code. > > > > > > > > > > > > > > TIA, > > > > > Lance > > > > > _______________________________________________ > > > > > 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 > > > > > > > > > _______________________________________________ > > 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 >
David Chelimsky
2007-Aug-08 18:41 UTC
[rspec-users] Problems with RESTfully generated helpers
On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote:> All I''m doing is passing the instance variables @label and @artist in > the controller to the view using this code: > > @label = current_user.labels.find(params[:label_id]) > @artist = params[:id].nil? ? Artist.new : @label.artists.find(params[:id]) > > By sending these two instance variables to the view, I don''t need to > specify these arguments and the view just works. Can you get it to > work when you specify these instance variables in your controller?No. That''s what I''m saying. I get the same ambigous URL error you cited in the first email in this thread, but in the browser. Using edge rails, edge rspec.> > -L > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > I just passed label_artist_path(@label.id, @artist.id) into the view > > > and it worked.. but I really don''t want to have to pass those > > > parameters in all my views. It looks ugly. Does anyone know a way > > > around this without stubbing? It seems useless to test this view > > > without allowing those methods to act out their real behavior. > > > > Can you point me to docs that say you''re supposed to be able to just > > call label_artist_path without any args? I''ve not see such docs and I > > can''t get it to work in any of my views - and I''m talking about just > > rendering the views at all, not getting specs to work. > > > > > > > > -TIA > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > ActionView::TemplateError in ''Edit Artist Page should render the edit > > > > artist form'' > > > > label_artist_url failed to generate from {:controller=>"artists", > > > > :action=>"show"} - you may have ambiguous routes, or you may need to > > > > supply additional parameters for this route. content_url has the > > > > following required parameters: ["labels", :label_id, "artists", :id] - > > > > are they all satisfied? > > > > On line #3 of app/views/artists/edit.rhtml > > > > > > > > 1: <h1>Editing artist</h1> > > > > 2: > > > > 3: <% form_tag label_artist_path, :method => :put do %> > > > > 4: <%= render :partial => ''form'' %> > > > > 5: <%= submit_tag ''Save'' %> > > > > 6: <% end %> > > > > > > > > > > > > My spec looks like: > > > > > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > > > > > describe ''Edit Artist Page'' do > > > > before do > > > > @label = mock_model(Label) > > > > @artist = mock_model(Artist) > > > > > > > > assigns[:label] = @label > > > > assigns[:artist] = @artist > > > > end > > > > > > > > def render_edit > > > > render :template => ''artists/edit'' > > > > end > > > > > > > > it "should render the edit artist form" do > > > > render_edit > > > > end > > > > end > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > I am using helper the RESTfully generated helper methods in my views. > > > > > > My routes are nested so the helpers appear to need arguments passed to > > > > > > them, but it works without arguments. Say for example I have pages and > > > > > > comments. If I do page_comments_path without parameters, it works. > > > > > > However, when I run the rspec test, it fails and tells me i''m missing > > > > > > parameters. I tried to pass params[:page_id], but it still says it > > > > > > needs parameters. I did fill in the parameters like it asked and the > > > > > > test passed, but I think my views look cleaner without the arguments > > > > > > being passed everywhere. Do I have to stub these methods to get my > > > > > > views to pass, or is there some other way? > > > > > > > > > > It would be much easier to answer your question if you posted the > > > > > actual spec and code. > > > > > > > > > > > > > > > > > TIA, > > > > > > Lance > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > > > > _______________________________________________ > > > 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 > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Lance Carlson
2007-Aug-08 18:46 UTC
[rspec-users] Problems with RESTfully generated helpers
I just visited the action in my browser and i don''t get any errors. I am also running on edge rails as the application relies on ActiveResource. Can you show me the code you created? On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > All I''m doing is passing the instance variables @label and @artist in > > the controller to the view using this code: > > > > @label = current_user.labels.find(params[:label_id]) > > @artist = params[:id].nil? ? Artist.new : @label.artists.find(params[:id]) > > > > By sending these two instance variables to the view, I don''t need to > > specify these arguments and the view just works. Can you get it to > > work when you specify these instance variables in your controller? > > No. That''s what I''m saying. I get the same ambigous URL error you > cited in the first email in this thread, but in the browser. Using > edge rails, edge rspec. > > > > > -L > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > I just passed label_artist_path(@label.id, @artist.id) into the view > > > > and it worked.. but I really don''t want to have to pass those > > > > parameters in all my views. It looks ugly. Does anyone know a way > > > > around this without stubbing? It seems useless to test this view > > > > without allowing those methods to act out their real behavior. > > > > > > Can you point me to docs that say you''re supposed to be able to just > > > call label_artist_path without any args? I''ve not see such docs and I > > > can''t get it to work in any of my views - and I''m talking about just > > > rendering the views at all, not getting specs to work. > > > > > > > > > > > -TIA > > > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > ActionView::TemplateError in ''Edit Artist Page should render the edit > > > > > artist form'' > > > > > label_artist_url failed to generate from {:controller=>"artists", > > > > > :action=>"show"} - you may have ambiguous routes, or you may need to > > > > > supply additional parameters for this route. content_url has the > > > > > following required parameters: ["labels", :label_id, "artists", :id] - > > > > > are they all satisfied? > > > > > On line #3 of app/views/artists/edit.rhtml > > > > > > > > > > 1: <h1>Editing artist</h1> > > > > > 2: > > > > > 3: <% form_tag label_artist_path, :method => :put do %> > > > > > 4: <%= render :partial => ''form'' %> > > > > > 5: <%= submit_tag ''Save'' %> > > > > > 6: <% end %> > > > > > > > > > > > > > > > My spec looks like: > > > > > > > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > > > > > > > describe ''Edit Artist Page'' do > > > > > before do > > > > > @label = mock_model(Label) > > > > > @artist = mock_model(Artist) > > > > > > > > > > assigns[:label] = @label > > > > > assigns[:artist] = @artist > > > > > end > > > > > > > > > > def render_edit > > > > > render :template => ''artists/edit'' > > > > > end > > > > > > > > > > it "should render the edit artist form" do > > > > > render_edit > > > > > end > > > > > end > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > I am using helper the RESTfully generated helper methods in my views. > > > > > > > My routes are nested so the helpers appear to need arguments passed to > > > > > > > them, but it works without arguments. Say for example I have pages and > > > > > > > comments. If I do page_comments_path without parameters, it works. > > > > > > > However, when I run the rspec test, it fails and tells me i''m missing > > > > > > > parameters. I tried to pass params[:page_id], but it still says it > > > > > > > needs parameters. I did fill in the parameters like it asked and the > > > > > > > test passed, but I think my views look cleaner without the arguments > > > > > > > being passed everywhere. Do I have to stub these methods to get my > > > > > > > views to pass, or is there some other way? > > > > > > > > > > > > It would be much easier to answer your question if you posted the > > > > > > actual spec and code. > > > > > > > > > > > > > > > > > > > > TIA, > > > > > > > Lance > > > > > > > _______________________________________________ > > > > > > > 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 > > > > > > > > > > > > > > > _______________________________________________ > > > > 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 > > > > > _______________________________________________ > > 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 >
Lance Carlson
2007-Aug-08 20:41 UTC
[rspec-users] Problems with RESTfully generated helpers
David, I know for a fact that these helpers do not require arguments to be sent to them. Does anyone have any idea why rspec is forcing this to happen? On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote:> I just visited the action in my browser and i don''t get any errors. I > am also running on edge rails as the application relies on > ActiveResource. Can you show me the code you created? > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > All I''m doing is passing the instance variables @label and @artist in > > > the controller to the view using this code: > > > > > > @label = current_user.labels.find(params[:label_id]) > > > @artist = params[:id].nil? ? Artist.new : @label.artists.find(params[:id]) > > > > > > By sending these two instance variables to the view, I don''t need to > > > specify these arguments and the view just works. Can you get it to > > > work when you specify these instance variables in your controller? > > > > No. That''s what I''m saying. I get the same ambigous URL error you > > cited in the first email in this thread, but in the browser. Using > > edge rails, edge rspec. > > > > > > > > -L > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > I just passed label_artist_path(@label.id, @artist.id) into the view > > > > > and it worked.. but I really don''t want to have to pass those > > > > > parameters in all my views. It looks ugly. Does anyone know a way > > > > > around this without stubbing? It seems useless to test this view > > > > > without allowing those methods to act out their real behavior. > > > > > > > > Can you point me to docs that say you''re supposed to be able to just > > > > call label_artist_path without any args? I''ve not see such docs and I > > > > can''t get it to work in any of my views - and I''m talking about just > > > > rendering the views at all, not getting specs to work. > > > > > > > > > > > > > > -TIA > > > > > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > ActionView::TemplateError in ''Edit Artist Page should render the edit > > > > > > artist form'' > > > > > > label_artist_url failed to generate from {:controller=>"artists", > > > > > > :action=>"show"} - you may have ambiguous routes, or you may need to > > > > > > supply additional parameters for this route. content_url has the > > > > > > following required parameters: ["labels", :label_id, "artists", :id] - > > > > > > are they all satisfied? > > > > > > On line #3 of app/views/artists/edit.rhtml > > > > > > > > > > > > 1: <h1>Editing artist</h1> > > > > > > 2: > > > > > > 3: <% form_tag label_artist_path, :method => :put do %> > > > > > > 4: <%= render :partial => ''form'' %> > > > > > > 5: <%= submit_tag ''Save'' %> > > > > > > 6: <% end %> > > > > > > > > > > > > > > > > > > My spec looks like: > > > > > > > > > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > > > > > > > > > describe ''Edit Artist Page'' do > > > > > > before do > > > > > > @label = mock_model(Label) > > > > > > @artist = mock_model(Artist) > > > > > > > > > > > > assigns[:label] = @label > > > > > > assigns[:artist] = @artist > > > > > > end > > > > > > > > > > > > def render_edit > > > > > > render :template => ''artists/edit'' > > > > > > end > > > > > > > > > > > > it "should render the edit artist form" do > > > > > > render_edit > > > > > > end > > > > > > end > > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > > I am using helper the RESTfully generated helper methods in my views. > > > > > > > > My routes are nested so the helpers appear to need arguments passed to > > > > > > > > them, but it works without arguments. Say for example I have pages and > > > > > > > > comments. If I do page_comments_path without parameters, it works. > > > > > > > > However, when I run the rspec test, it fails and tells me i''m missing > > > > > > > > parameters. I tried to pass params[:page_id], but it still says it > > > > > > > > needs parameters. I did fill in the parameters like it asked and the > > > > > > > > test passed, but I think my views look cleaner without the arguments > > > > > > > > being passed everywhere. Do I have to stub these methods to get my > > > > > > > > views to pass, or is there some other way? > > > > > > > > > > > > > > It would be much easier to answer your question if you posted the > > > > > > > actual spec and code. > > > > > > > > > > > > > > > > > > > > > > > TIA, > > > > > > > > Lance > > > > > > > > _______________________________________________ > > > > > > > > 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 > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > 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 > > > > > > > _______________________________________________ > > > 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 > > >
David Chelimsky wrote:> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: >> All I''m doing is passing the instance variables @label and @artist in >> the controller to the view using this code: >> >> @label = current_user.labels.find(params[:label_id]) >> @artist = params[:id].nil? ? Artist.new : @label.artists.find(params[:id]) >> >> By sending these two instance variables to the view, I don''t need to >> specify these arguments and the view just works. Can you get it to >> work when you specify these instance variables in your controller? > > No. That''s what I''m saying. I get the same ambigous URL error you > cited in the first email in this thread, but in the browser. Using > edge rails, edge rspec.Dumb question, but do you have the resource mapped in your routes.rb file? Something like map.resources :artists Jay> >> -L >> >> On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: >>> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: >>>> I just passed label_artist_path(@label.id, @artist.id) into the view >>>> and it worked.. but I really don''t want to have to pass those >>>> parameters in all my views. It looks ugly. Does anyone know a way >>>> around this without stubbing? It seems useless to test this view >>>> without allowing those methods to act out their real behavior. >>> Can you point me to docs that say you''re supposed to be able to just >>> call label_artist_path without any args? I''ve not see such docs and I >>> can''t get it to work in any of my views - and I''m talking about just >>> rendering the views at all, not getting specs to work. >>> >>>> -TIA >>>> >>>> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: >>>>> ActionView::TemplateError in ''Edit Artist Page should render the edit >>>>> artist form'' >>>>> label_artist_url failed to generate from {:controller=>"artists", >>>>> :action=>"show"} - you may have ambiguous routes, or you may need to >>>>> supply additional parameters for this route. content_url has the >>>>> following required parameters: ["labels", :label_id, "artists", :id] - >>>>> are they all satisfied? >>>>> On line #3 of app/views/artists/edit.rhtml >>>>> >>>>> 1: <h1>Editing artist</h1> >>>>> 2: >>>>> 3: <% form_tag label_artist_path, :method => :put do %> >>>>> 4: <%= render :partial => ''form'' %> >>>>> 5: <%= submit_tag ''Save'' %> >>>>> 6: <% end %> >>>>> >>>>> >>>>> My spec looks like: >>>>> >>>>> require File.dirname(__FILE__) + ''/../../spec_helper'' >>>>> >>>>> describe ''Edit Artist Page'' do >>>>> before do >>>>> @label = mock_model(Label) >>>>> @artist = mock_model(Artist) >>>>> >>>>> assigns[:label] = @label >>>>> assigns[:artist] = @artist >>>>> end >>>>> >>>>> def render_edit >>>>> render :template => ''artists/edit'' >>>>> end >>>>> >>>>> it "should render the edit artist form" do >>>>> render_edit >>>>> end >>>>> end >>>>> >>>>> On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: >>>>>> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: >>>>>>> I am using helper the RESTfully generated helper methods in my views. >>>>>>> My routes are nested so the helpers appear to need arguments passed to >>>>>>> them, but it works without arguments. Say for example I have pages and >>>>>>> comments. If I do page_comments_path without parameters, it works. >>>>>>> However, when I run the rspec test, it fails and tells me i''m missing >>>>>>> parameters. I tried to pass params[:page_id], but it still says it >>>>>>> needs parameters. I did fill in the parameters like it asked and the >>>>>>> test passed, but I think my views look cleaner without the arguments >>>>>>> being passed everywhere. Do I have to stub these methods to get my >>>>>>> views to pass, or is there some other way? >>>>>> It would be much easier to answer your question if you posted the >>>>>> actual spec and code. >>>>>> >>>>>>> TIA, >>>>>>> Lance >>>>>>> _______________________________________________ >>>>>>> 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 >>>>>> >>>> _______________________________________________ >>>> 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 >>> >> _______________________________________________ >> 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
Lance Carlson
2007-Aug-08 20:48 UTC
[rspec-users] Problems with RESTfully generated helpers
Yes, map.resources :labels do |label| label.resources :artists end On 8/8/07, Jay Levitt <lists-rspec at shopwatch.org> wrote:> David Chelimsky wrote: > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > >> All I''m doing is passing the instance variables @label and @artist in > >> the controller to the view using this code: > >> > >> @label = current_user.labels.find(params[:label_id]) > >> @artist = params[:id].nil? ? Artist.new : @label.artists.find(params[:id]) > >> > >> By sending these two instance variables to the view, I don''t need to > >> specify these arguments and the view just works. Can you get it to > >> work when you specify these instance variables in your controller? > > > > No. That''s what I''m saying. I get the same ambigous URL error you > > cited in the first email in this thread, but in the browser. Using > > edge rails, edge rspec. > > Dumb question, but do you have the resource mapped in your routes.rb > file? Something like > > map.resources :artists > > Jay > > > > >> -L > >> > >> On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > >>> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > >>>> I just passed label_artist_path(@label.id, @artist.id) into the view > >>>> and it worked.. but I really don''t want to have to pass those > >>>> parameters in all my views. It looks ugly. Does anyone know a way > >>>> around this without stubbing? It seems useless to test this view > >>>> without allowing those methods to act out their real behavior. > >>> Can you point me to docs that say you''re supposed to be able to just > >>> call label_artist_path without any args? I''ve not see such docs and I > >>> can''t get it to work in any of my views - and I''m talking about just > >>> rendering the views at all, not getting specs to work. > >>> > >>>> -TIA > >>>> > >>>> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > >>>>> ActionView::TemplateError in ''Edit Artist Page should render the edit > >>>>> artist form'' > >>>>> label_artist_url failed to generate from {:controller=>"artists", > >>>>> :action=>"show"} - you may have ambiguous routes, or you may need to > >>>>> supply additional parameters for this route. content_url has the > >>>>> following required parameters: ["labels", :label_id, "artists", :id] - > >>>>> are they all satisfied? > >>>>> On line #3 of app/views/artists/edit.rhtml > >>>>> > >>>>> 1: <h1>Editing artist</h1> > >>>>> 2: > >>>>> 3: <% form_tag label_artist_path, :method => :put do %> > >>>>> 4: <%= render :partial => ''form'' %> > >>>>> 5: <%= submit_tag ''Save'' %> > >>>>> 6: <% end %> > >>>>> > >>>>> > >>>>> My spec looks like: > >>>>> > >>>>> require File.dirname(__FILE__) + ''/../../spec_helper'' > >>>>> > >>>>> describe ''Edit Artist Page'' do > >>>>> before do > >>>>> @label = mock_model(Label) > >>>>> @artist = mock_model(Artist) > >>>>> > >>>>> assigns[:label] = @label > >>>>> assigns[:artist] = @artist > >>>>> end > >>>>> > >>>>> def render_edit > >>>>> render :template => ''artists/edit'' > >>>>> end > >>>>> > >>>>> it "should render the edit artist form" do > >>>>> render_edit > >>>>> end > >>>>> end > >>>>> > >>>>> On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > >>>>>> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > >>>>>>> I am using helper the RESTfully generated helper methods in my views. > >>>>>>> My routes are nested so the helpers appear to need arguments passed to > >>>>>>> them, but it works without arguments. Say for example I have pages and > >>>>>>> comments. If I do page_comments_path without parameters, it works. > >>>>>>> However, when I run the rspec test, it fails and tells me i''m missing > >>>>>>> parameters. I tried to pass params[:page_id], but it still says it > >>>>>>> needs parameters. I did fill in the parameters like it asked and the > >>>>>>> test passed, but I think my views look cleaner without the arguments > >>>>>>> being passed everywhere. Do I have to stub these methods to get my > >>>>>>> views to pass, or is there some other way? > >>>>>> It would be much easier to answer your question if you posted the > >>>>>> actual spec and code. > >>>>>> > >>>>>>> TIA, > >>>>>>> Lance > >>>>>>> _______________________________________________ > >>>>>>> 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 > >>>>>> > >>>> _______________________________________________ > >>>> 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 > >>> > >> _______________________________________________ > >> 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 > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2007-Aug-08 22:53 UTC
[rspec-users] Problems with RESTfully generated helpers
On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote:> I just visited the action in my browser and i don''t get any errors. I > am also running on edge rails as the application relies on > ActiveResource. Can you show me the code you created?OK - I''ve created a small project and am able to reproduce the behaviour you''re describing. I''ll follow up when learn something. David
Lance Carlson
2007-Aug-08 22:56 UTC
[rspec-users] Problems with RESTfully generated helpers
Awesome! Thank you! :) On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > I just visited the action in my browser and i don''t get any errors. I > > am also running on edge rails as the application relies on > > ActiveResource. Can you show me the code you created? > > OK - I''ve created a small project and am able to reproduce the > behaviour you''re describing. I''ll follow up when learn something. > > David > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2007-Aug-09 02:35 UTC
[rspec-users] Problems with RESTfully generated helpers
On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote:> Awesome! Thank you! :)Don''t thank me yet. I''ve spent some time trying to track this down and I''ve found my way into some methods in routing.rb that are dynamically generated (and so you can''t )(*&)(*& read them to debug them quite so easily) that call the methods (in your case) label_id_value and id_value (being the artist id). I have no idea yet where those two methods get generated. Once I do, then we can stub them. Unfortunately I can''t really spend any more time on this right now (though I''d love to solve it). In the mean time, you''ll just have to use the parameters if you want the specs to work with the same code with which your app works.> > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > I just visited the action in my browser and i don''t get any errors. I > > > am also running on edge rails as the application relies on > > > ActiveResource. Can you show me the code you created? > > > > OK - I''ve created a small project and am able to reproduce the > > behaviour you''re describing. I''ll follow up when learn something. > > > > David > > _______________________________________________ > > 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 >
Lance Carlson
2007-Aug-10 00:11 UTC
[rspec-users] Problems with RESTfully generated helpers
Were you able to come up with any solutions? On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > Awesome! Thank you! :) > > Don''t thank me yet. I''ve spent some time trying to track this down and > I''ve found my way into some methods in routing.rb that are dynamically > generated (and so you can''t )(*&)(*& read them to debug them quite so > easily) that call the methods (in your case) label_id_value and > id_value (being the artist id). I have no idea yet where those two > methods get generated. Once I do, then we can stub them. Unfortunately > I can''t really spend any more time on this right now (though I''d love > to solve it). > > In the mean time, you''ll just have to use the parameters if you want > the specs to work with the same code with which your app works. > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > I just visited the action in my browser and i don''t get any errors. I > > > > am also running on edge rails as the application relies on > > > > ActiveResource. Can you show me the code you created? > > > > > > OK - I''ve created a small project and am able to reproduce the > > > behaviour you''re describing. I''ll follow up when learn something. > > > > > > David > > > _______________________________________________ > > > 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 > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2007-Aug-10 00:16 UTC
[rspec-users] Problems with RESTfully generated helpers
On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote:> Were you able to come up with any solutions?Nope. Anyone else?> > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > Awesome! Thank you! :) > > > > Don''t thank me yet. I''ve spent some time trying to track this down and > > I''ve found my way into some methods in routing.rb that are dynamically > > generated (and so you can''t )(*&)(*& read them to debug them quite so > > easily) that call the methods (in your case) label_id_value and > > id_value (being the artist id). I have no idea yet where those two > > methods get generated. Once I do, then we can stub them. Unfortunately > > I can''t really spend any more time on this right now (though I''d love > > to solve it). > > > > In the mean time, you''ll just have to use the parameters if you want > > the specs to work with the same code with which your app works. > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > I just visited the action in my browser and i don''t get any errors. I > > > > > am also running on edge rails as the application relies on > > > > > ActiveResource. Can you show me the code you created? > > > > > > > > OK - I''ve created a small project and am able to reproduce the > > > > behaviour you''re describing. I''ll follow up when learn something. > > > > > > > > David > > > > _______________________________________________ > > > > 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 > > > > > _______________________________________________ > > 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 >
Lance Carlson
2007-Aug-10 00:21 UTC
[rspec-users] Problems with RESTfully generated helpers
Is it possible that rspec is not pulling the instance variables into the method because this method is being defined before instance variables in parameters are assigned to that method? I''m trying to hone down where the problem is popping up exactly. Any insight? On 8/9/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > Were you able to come up with any solutions? > > Nope. Anyone else? > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > Awesome! Thank you! :) > > > > > > Don''t thank me yet. I''ve spent some time trying to track this down and > > > I''ve found my way into some methods in routing.rb that are dynamically > > > generated (and so you can''t )(*&)(*& read them to debug them quite so > > > easily) that call the methods (in your case) label_id_value and > > > id_value (being the artist id). I have no idea yet where those two > > > methods get generated. Once I do, then we can stub them. Unfortunately > > > I can''t really spend any more time on this right now (though I''d love > > > to solve it). > > > > > > In the mean time, you''ll just have to use the parameters if you want > > > the specs to work with the same code with which your app works. > > > > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > I just visited the action in my browser and i don''t get any errors. I > > > > > > am also running on edge rails as the application relies on > > > > > > ActiveResource. Can you show me the code you created? > > > > > > > > > > OK - I''ve created a small project and am able to reproduce the > > > > > behaviour you''re describing. I''ll follow up when learn something. > > > > > > > > > > David > > > > > _______________________________________________ > > > > > 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 > > > > > > > _______________________________________________ > > > 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 > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2007-Aug-10 00:31 UTC
[rspec-users] Problems with RESTfully generated helpers
On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote:> Is it possible that rspec is not pulling the instance variables into > the method because this method is being defined before instance > variables in parameters are assigned to that method? I''m trying to > hone down where the problem is popping up exactly. Any insight?Not really more than what I said earlier in this thread.> On 8/9/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > Were you able to come up with any solutions? > > > > Nope. Anyone else? > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > Awesome! Thank you! :) > > > > > > > > Don''t thank me yet. I''ve spent some time trying to track this down and > > > > I''ve found my way into some methods in routing.rb that are dynamically > > > > generated (and so you can''t )(*&)(*& read them to debug them quite so > > > > easily) that call the methods (in your case) label_id_value and > > > > id_value (being the artist id). I have no idea yet where those two > > > > methods get generated. Once I do, then we can stub them. Unfortunately > > > > I can''t really spend any more time on this right now (though I''d love > > > > to solve it). > > > > > > > > In the mean time, you''ll just have to use the parameters if you want > > > > the specs to work with the same code with which your app works. > > > > > > > > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > I just visited the action in my browser and i don''t get any errors. I > > > > > > > am also running on edge rails as the application relies on > > > > > > > ActiveResource. Can you show me the code you created? > > > > > > > > > > > > OK - I''ve created a small project and am able to reproduce the > > > > > > behaviour you''re describing. I''ll follow up when learn something. > > > > > > > > > > > > David > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > _______________________________________________ > > > > 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 > > > > > _______________________________________________ > > 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 >
Lance Carlson
2007-Aug-10 00:36 UTC
[rspec-users] Problems with RESTfully generated helpers
About these methods requiring arguments? I thought you were able to reproduce the problems I was having and was also able to reproduce a working application with no arguments. By default these methods should not require arguments to be passed as it is unnecessary noise in the code. Perhaps we can continue this discussion on IRC? #rspec? What is your s/n? On 8/9/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > Is it possible that rspec is not pulling the instance variables into > > the method because this method is being defined before instance > > variables in parameters are assigned to that method? I''m trying to > > hone down where the problem is popping up exactly. Any insight? > > Not really more than what I said earlier in this thread. > > > On 8/9/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > Were you able to come up with any solutions? > > > > > > Nope. Anyone else? > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > Awesome! Thank you! :) > > > > > > > > > > Don''t thank me yet. I''ve spent some time trying to track this down and > > > > > I''ve found my way into some methods in routing.rb that are dynamically > > > > > generated (and so you can''t )(*&)(*& read them to debug them quite so > > > > > easily) that call the methods (in your case) label_id_value and > > > > > id_value (being the artist id). I have no idea yet where those two > > > > > methods get generated. Once I do, then we can stub them. Unfortunately > > > > > I can''t really spend any more time on this right now (though I''d love > > > > > to solve it). > > > > > > > > > > In the mean time, you''ll just have to use the parameters if you want > > > > > the specs to work with the same code with which your app works. > > > > > > > > > > > > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > > I just visited the action in my browser and i don''t get any errors. I > > > > > > > > am also running on edge rails as the application relies on > > > > > > > > ActiveResource. Can you show me the code you created? > > > > > > > > > > > > > > OK - I''ve created a small project and am able to reproduce the > > > > > > > behaviour you''re describing. I''ll follow up when learn something. > > > > > > > > > > > > > > David > > > > > > > _______________________________________________ > > > > > > > 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 > > > > > > > > > > > _______________________________________________ > > > > > 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 > > > > > > > _______________________________________________ > > > 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 > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Hi all, did anybody get ''fixture scenario builder'' (http://errtheblog.com/post/ 7708) to work with rspec? I am getting the following error: ..../plugins/fixture_scenarios_builder/lib/scenario_builder.rb:8:in `scenario'': undefined method `scenario'' for main (NoMethodError) Ingo
David Chelimsky
2007-Aug-10 12:04 UTC
[rspec-users] Problems with RESTfully generated helpers
On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote:> About these methods requiring arguments? I thought you were able to > reproduce the problems I was having and was also able to reproduce a > working application with no arguments.That is correct.> By default these methods should > not require arguments to be passed as it is unnecessary noise in the > code.I understand that, but that was news to me as of this thread. I spent a couple of hours banging my head against this and found the generated code I mentioned earlier in the thread. That''s the only insight I have to offer at this point.> Perhaps we can continue this discussion on IRC? #rspec?I''ll pop in at one point this morning but I really don''t have much in the way of cycles to spend on this right now. I''m happy to help point you in the right direction, but it''s not very high on my priority list. In the mean time, now that we know this is a bug, would you kindly report it in the tracker? http://rubyforge.org/tracker/?atid=3149&group_id=797&func=browse> What is your s/n? > > On 8/9/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > Is it possible that rspec is not pulling the instance variables into > > > the method because this method is being defined before instance > > > variables in parameters are assigned to that method? I''m trying to > > > hone down where the problem is popping up exactly. Any insight? > > > > Not really more than what I said earlier in this thread. > > > > > On 8/9/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > Were you able to come up with any solutions? > > > > > > > > Nope. Anyone else? > > > > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > Awesome! Thank you! :) > > > > > > > > > > > > Don''t thank me yet. I''ve spent some time trying to track this down and > > > > > > I''ve found my way into some methods in routing.rb that are dynamically > > > > > > generated (and so you can''t )(*&)(*& read them to debug them quite so > > > > > > easily) that call the methods (in your case) label_id_value and > > > > > > id_value (being the artist id). I have no idea yet where those two > > > > > > methods get generated. Once I do, then we can stub them. Unfortunately > > > > > > I can''t really spend any more time on this right now (though I''d love > > > > > > to solve it). > > > > > > > > > > > > In the mean time, you''ll just have to use the parameters if you want > > > > > > the specs to work with the same code with which your app works. > > > > > > > > > > > > > > > > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > > > I just visited the action in my browser and i don''t get any errors. I > > > > > > > > > am also running on edge rails as the application relies on > > > > > > > > > ActiveResource. Can you show me the code you created? > > > > > > > > > > > > > > > > OK - I''ve created a small project and am able to reproduce the > > > > > > > > behaviour you''re describing. I''ll follow up when learn something. > > > > > > > > > > > > > > > > David > > > > > > > > _______________________________________________ > > > > > > > > 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 > > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > _______________________________________________ > > > > 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 > > > > > _______________________________________________ > > 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 >
Lance Carlson
2007-Aug-10 14:04 UTC
[rspec-users] Problems with RESTfully generated helpers
Thanks for your patience trying to resolve this issue. I posted a bug report here: http://rubyforge.org/tracker/index.php?func=detail&aid=12963&group_id=797&atid=3149 On 8/10/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > About these methods requiring arguments? I thought you were able to > > reproduce the problems I was having and was also able to reproduce a > > working application with no arguments. > > That is correct. > > > By default these methods should > > not require arguments to be passed as it is unnecessary noise in the > > code. > > I understand that, but that was news to me as of this thread. I spent > a couple of hours banging my head against this and found the generated > code I mentioned earlier in the thread. That''s the only insight I have > to offer at this point. > > > Perhaps we can continue this discussion on IRC? #rspec? > > I''ll pop in at one point this morning but I really don''t have much in > the way of cycles to spend on this right now. I''m happy to help point > you in the right direction, but it''s not very high on my priority > list. In the mean time, now that we know this is a bug, would you > kindly report it in the tracker? > > http://rubyforge.org/tracker/?atid=3149&group_id=797&func=browse > > > What is your s/n? > > > > On 8/9/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > Is it possible that rspec is not pulling the instance variables into > > > > the method because this method is being defined before instance > > > > variables in parameters are assigned to that method? I''m trying to > > > > hone down where the problem is popping up exactly. Any insight? > > > > > > Not really more than what I said earlier in this thread. > > > > > > > On 8/9/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > Were you able to come up with any solutions? > > > > > > > > > > Nope. Anyone else? > > > > > > > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > > Awesome! Thank you! :) > > > > > > > > > > > > > > Don''t thank me yet. I''ve spent some time trying to track this down and > > > > > > > I''ve found my way into some methods in routing.rb that are dynamically > > > > > > > generated (and so you can''t )(*&)(*& read them to debug them quite so > > > > > > > easily) that call the methods (in your case) label_id_value and > > > > > > > id_value (being the artist id). I have no idea yet where those two > > > > > > > methods get generated. Once I do, then we can stub them. Unfortunately > > > > > > > I can''t really spend any more time on this right now (though I''d love > > > > > > > to solve it). > > > > > > > > > > > > > > In the mean time, you''ll just have to use the parameters if you want > > > > > > > the specs to work with the same code with which your app works. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > > > > I just visited the action in my browser and i don''t get any errors. I > > > > > > > > > > am also running on edge rails as the application relies on > > > > > > > > > > ActiveResource. Can you show me the code you created? > > > > > > > > > > > > > > > > > > OK - I''ve created a small project and am able to reproduce the > > > > > > > > > behaviour you''re describing. I''ll follow up when learn something. > > > > > > > > > > > > > > > > > > David > > > > > > > > > _______________________________________________ > > > > > > > > > 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 > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > 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 > > > > > > > > > > > _______________________________________________ > > > > > 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 > > > > > > > _______________________________________________ > > > 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 > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2007-Aug-10 14:05 UTC
[rspec-users] Problems with RESTfully generated helpers
On 8/10/07, Lance Carlson <lancecarlson at gmail.com> wrote:> Thanks for your patience trying to resolve this issue. I posted a bug > report here: > > http://rubyforge.org/tracker/index.php?func=detail&aid=12963&group_id=797&atid=3149I see it - thanks. If you have time now, Lance, pls join the #rspec IRC chat.> > On 8/10/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > About these methods requiring arguments? I thought you were able to > > > reproduce the problems I was having and was also able to reproduce a > > > working application with no arguments. > > > > That is correct. > > > > > By default these methods should > > > not require arguments to be passed as it is unnecessary noise in the > > > code. > > > > I understand that, but that was news to me as of this thread. I spent > > a couple of hours banging my head against this and found the generated > > code I mentioned earlier in the thread. That''s the only insight I have > > to offer at this point. > > > > > Perhaps we can continue this discussion on IRC? #rspec? > > > > I''ll pop in at one point this morning but I really don''t have much in > > the way of cycles to spend on this right now. I''m happy to help point > > you in the right direction, but it''s not very high on my priority > > list. In the mean time, now that we know this is a bug, would you > > kindly report it in the tracker? > > > > http://rubyforge.org/tracker/?atid=3149&group_id=797&func=browse > > > > > What is your s/n? > > > > > > On 8/9/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > Is it possible that rspec is not pulling the instance variables into > > > > > the method because this method is being defined before instance > > > > > variables in parameters are assigned to that method? I''m trying to > > > > > hone down where the problem is popping up exactly. Any insight? > > > > > > > > Not really more than what I said earlier in this thread. > > > > > > > > > On 8/9/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > On 8/9/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > Were you able to come up with any solutions? > > > > > > > > > > > > Nope. Anyone else? > > > > > > > > > > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > > > Awesome! Thank you! :) > > > > > > > > > > > > > > > > Don''t thank me yet. I''ve spent some time trying to track this down and > > > > > > > > I''ve found my way into some methods in routing.rb that are dynamically > > > > > > > > generated (and so you can''t )(*&)(*& read them to debug them quite so > > > > > > > > easily) that call the methods (in your case) label_id_value and > > > > > > > > id_value (being the artist id). I have no idea yet where those two > > > > > > > > methods get generated. Once I do, then we can stub them. Unfortunately > > > > > > > > I can''t really spend any more time on this right now (though I''d love > > > > > > > > to solve it). > > > > > > > > > > > > > > > > In the mean time, you''ll just have to use the parameters if you want > > > > > > > > the specs to work with the same code with which your app works. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On 8/8/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > > > > On 8/8/07, Lance Carlson <lancecarlson at gmail.com> wrote: > > > > > > > > > > > I just visited the action in my browser and i don''t get any errors. I > > > > > > > > > > > am also running on edge rails as the application relies on > > > > > > > > > > > ActiveResource. Can you show me the code you created? > > > > > > > > > > > > > > > > > > > > OK - I''ve created a small project and am able to reproduce the > > > > > > > > > > behaviour you''re describing. I''ll follow up when learn something. > > > > > > > > > > > > > > > > > > > > David > > > > > > > > > > _______________________________________________ > > > > > > > > > > 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 > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > 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 > > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > > > > > > _______________________________________________ > > > > 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 > > > > > _______________________________________________ > > 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 >
David Chelimsky wrote:> On 8/10/07, Lance Carlson <lancecarlson at gmail.com> wrote: >> Thanks for your patience trying to resolve this issue. I posted a bug >> report here: >> >> http://rubyforge.org/tracker/index.php?func=detail&aid=12963&group_id=797&atid=3149 > > I see it - thanks. If you have time now, Lance, pls join the #rspec IRC chat.How did this chat go, if it went? I''m about to dive into this problem but don''t want to duplicate efforts. Jay
Lance Carlson
2007-Aug-12 22:33 UTC
[rspec-users] Problems with RESTfully generated helpers
It was never resolved.. the only resolution was to mock out the methods at this point or provide the views with the instance variables. On 8/12/07, Jay Levitt <lists-rspec at shopwatch.org> wrote:> David Chelimsky wrote: > > On 8/10/07, Lance Carlson <lancecarlson at gmail.com> wrote: > >> Thanks for your patience trying to resolve this issue. I posted a bug > >> report here: > >> > >> http://rubyforge.org/tracker/index.php?func=detail&aid=12963&group_id=797&atid=3149 > > > > I see it - thanks. If you have time now, Lance, pls join the #rspec IRC chat. > > How did this chat go, if it went? I''m about to dive into this problem > but don''t want to duplicate efforts. > > Jay > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Lance Carlson wrote:> It was never resolved.. the only resolution was to mock out the > methods at this point or provide the views with the instance > variables.Well, I didn''t get anywhere tonight - but I did discover that script/console has the same problem. Given routes.rb: map.resources :users, :member => {:edit_business_card => :get, :update_business_card => :put } and: >> app.update_business_card_user_url I get: ActionController::RoutingError: update_business_card_user_url failed to generate from {:controller=>"users", :action=>"update_business_card"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["users", :id, "update_business_card"] - are they all satisfied? Yet using update_business_card_user_url from a view works fine. Since I can duplicate it without rspec, I''ll post a message to rubyonrails-talk and see if anyone has some ideas. Jay