similar to: Some tips for testing respond_to block and making controller tests work with simply_helpful

Displaying 20 results from an estimated 500 matches similar to: "Some tips for testing respond_to block and making controller tests work with simply_helpful"

2007 Apr 20
1
simply_helpful and edge
Does anyone have view specs running on edge with simply_helpful? I tried http://blog.methodmissing.com/2006/11/23/using-simply_helpful-with-rspec-controller-tests/but it seems that was written for pre-9 versions. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070420/0bc8d366/attachment.html
2006 Nov 07
7
should_redirect_to in advance - feels unnatural
I can understand that it''s easier for rspec to set up a mock in advance of the controller call. But it makes it difficult to do something like: context "The HarkController, given Louie the logged-in user" do setup do post :login, :username => ''louie'', :password => ''atest'' end specify "should redirect Louie to the home
2006 Oct 28
5
Seperate admin and public views using one controller REST CRUD
Hello, I want to seperate my admin and public views but only use one controller. How to seperate layouts ist clear but how can I tell the controller to render the *.rhtml files in views/admin/ when logged in or render the *.rhtml files in views/public/ (for example). Thanks for any help! PS: using REST and CRUD in edge rails --~--~---------~--~----~------------~-------~--~----~ You received
2006 Nov 24
13
rSpec on Rails 1.2?
I just updated my Rails install to the most current Edge and my controller specs fail: 1) TypeError in ''The User Controller should be a user controller'' can''t convert nil into String Each spec fails the same way. <context string> <spec string> can''t convert nil into String Any ideas what''s up with this? Thanks, s.ross
2006 Dec 13
4
RSpec and simply_helpful
Hi All I''m having some problems running my view specs when using simply_helpful. I have it semi-working via the following: module SimplyHelpfulHelper def self.included(base) base.send :include, SimplyHelpful::RecordIdentificationHelper base.send :include, SimplyHelpful::RecordTagHelper end end context "The index template" do setup do @shift =
2007 Feb 02
7
Coming Soon...
Dear spec''ers, As many of you already know, we''re gearing up for a pretty big 0.8 release of RSpec in the next couple of weeks. I''m writing in advance because I want to give you a heads up about upcoming changes and how they may impact your existing specs. Two important things to note first: 1. We will provide a translator that you''ll be able to use to
2007 Feb 01
3
should_redirect_to in rspec-0.8.0 / rspec_on_rails 1453
I have a spec: specify "a post with no user id should add a record" do post :edit_or_create, :user => {:login => ''joeschmoe'', :email => ''joe at shmoe.com'', :email_confirmation => ''joe at shmoe.com'', :full_name => ''Joe Schmoe''} assigns[:user].should_not_be_nil
2007 Feb 27
0
Simply_helpful and nested resources
Hi all, my question is Does simply_helpful is ready for use with nested resources ? I''ve tried something like : # Routes.rb map.resources :projects do |projects| projects.resources :iterations end # edit.rhtml <% form_for(@project, @iteration) do |f| %> # => <form action="/projects/1/iterations/3;edit" method="post"> # new.html # =>
2007 Jan 05
2
Using RESTful routes in controller tests
Why can''t I use the RESTful route helpers in my specs? In my controller I''m doing a redirect: redirect_to list_path(:id => @item.list_id) Now when I write: controller.should_redirect_to list_path(:id => 2) I''m getting the following error: NoMethodError in ''POST on /lists/2/items should redirect to index on succesful POST'' You have a nil object
2007 May 30
2
should_eql etc?
Hi, I''m trying the specs for restful_authentication I found here http://jonathan.tron.name/articles/2007/01/02/rspec-on-rails-restful- authentication It seems to use custom .should methods: should_eql, should_be_an_instance_of, should_redirect_to, should_be_success, should_not_be_nil, should_be_nil, should_not_be_nil, should_be_empty, should_be_success, should_not_change, and
2006 Dec 05
7
Dynamic # of Attributes for a Model (key/val table) Get/Set?
I''m working on a simple product catalog. Products have user defined attributes, such as: color, size, weight. More attributes can be added at any time. Since these attributes are not known ahead of time, they cannot be created as columns. My table structure (simplified): products -------- id name attrs -------- id name product_attrs -------- id attr_id value And some sample code: ##
2007 Jun 19
5
Problems translating should_render from 0.8.2 to 1.0.5
<font size="2">I''m working on a large Rails site and we want to move from RSpec 0.8.2 to the latest and greatest.&nbsp; So we ran the translator and yet we''re having a lot of trouble translating should_render.<br><br>I found this on the web:<br><br>We will NOT be supporting the following in the new syntax:<br>&nbsp;
2007 Jan 03
2
error_message_on broken?
Hi, in my app, using the error_message_on form helper like this: <label for="user_name">User name:</label> <%= error_message_on ''user'', :name %> <%= f.text_field :name %> generates the following error: undefined method `errors'' for :user:Symbol I am using edge revision 5813 and the simply_helpful plugin. Is there a way to fix this?
2003 Jan 11
3
Multithreading
Hi. I need to execute a function from within a GUI. This seems to be no problem but this function takes about 4 minutes to finish, which means the application doesn't react at all, while the function is running. Can I execute a function as a separate Thread, while keeping control(e.g. a reference) of it at the same time? If not, how do this with a class containing this function? thanks,
2006 Dec 13
3
Testing has_many :through
I''m working with a has_many :through association, where a Member has_many Projects through ProjectViewers. The problem I''m running into is that Rails doesn''t load the association so line (3) fails until I explicitly access a member of the collection (in this case, I iterated it). Is there a better way? Thanks, Steve 1. assigns[:member].should_not_be_nil 2.
2002 Sep 19
3
Using large-scale repetition in audio compression
This idea is so simple that I'm sure it must have been thought of before, and discarded, since AFAIK it's not used anywhere. I did a quick web search but that didn't turn up much, so I figured I'd put it up for discussion here anyway. How about using large-scale repetition in audio compression? I'm thinking of redundancy in repeated pieces of a song, ie a chorus.
2001 Feb 07
2
video codec
Hi Lourens, I fixed the YUV conversion and added a 'skip-empty-bitplanes' feature. The latter is still buggy, I have to check this again. But images look mach better now, even if you use higher compression ratios. (try ./main 1500 150 150 for a 352x288 image -- the output becomes blurred, but how does it looks when you compress it using jpeg down to about 2kB ...). Source is available
2003 Sep 30
3
fitdistr, mle's and gamma distribution
Dear R Users, I am trying to obtain a best-fit analytic distribution for a dataset with 11535459 entries. The data range in value from 1 to 300000000. I use: fitdistr(data, "gamma") to obtain mle's for the parameters. I get the following error: Error in optim(start, mylogfn, x = x, hessian = TRUE, ...) : non-finite finite-difference value [1] And the following warnings:
2007 Apr 11
10
DRYer controller specs
So, I''ve been following the recommendations for controller specs here: http://blog.davidchelimsky.net/articles/2006/11/09/tutorial-rspec-stubs-and-mocks Most notably: a single expectation per specify block; the setup block contains only stubs; mock expectations each get their own specify block. (I''m still using 0.8, so I haven''t gotten the describe/it goodness yet.) I
2004 Feb 18
5
compiling vorbis in cygwin
Hi, On compiling vorbis in a cygwin shell using "./autogen.sh" I get the following error... configure:19396: checking for Ogg configure:19431: gcc -o conftest.exe -O20 -D__NO_MATH_INLINES -fsigned-char -DUSE_MEMORY_H conftest.c -lm -logg >&5 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/ld: cannot find -logg collect2: ld returned 1 exit status The