Displaying 20 results from an estimated 1000 matches similar to: "Confused about square bracket usage."
2008 Nov 27
2
git .gitignore vs exclude file
I am a bit confused about the different purpose of each.
I think the .gitignore file belongs in the root of my project and is
project specific, but that also seems to be the reason for the .git/
info/exclude file
what happens if they conflict? which one wins.
What is standard practice?
My exclude file looks like this
# git-ls-files --others --exclude-from=.git/info/exclude
log/*.log
tmp/**/*
2008 Jul 05
5
Does RSpec work nicely with UUID primary keys?
I have my application happily generating UUID primary keys using the
uuidtools gem.
But the auto-generated specifications created by "script/generate
rspec_scaffold...", etc, assume that one is using a sequential integer
primary key.
For those who have hit this same issue, is it just a matter of rewriting
the auto-generated specifications to take this into account, or does one
have to
2014 Apr 04
0
Rspec not running properly
Hello everybody,
Being a new user of RoR, i'm experiencing a problem using Rspec, it
should end without errors but I still get this result:
PS C:\RubyTools\rubygems-2.2.2\rails_projects\sample_app> rspec spec
Called from:
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/session/abstract_store.rb:28:in
`initialize'.
2009 Feb 06
6
RecordNotFound bubbling thru to cucumber
Hello,
I have a controller action that raises a RecordNotFound exception if
you''re not allowed to see something. In my global application
controller (application.rb), I catch these and render the 404
template. But when I run cucumber (using webrat), it''s getting the
full stacktrace (the step blows up). Any ideas why? I have
consider_all_requests_local turned off in my test.rb.
2009 Sep 22
4
rspec-rails and rack middleware
It doesn''t seem like my controller specs are calling my middleware on
requests. Has anyone figured out a good way to test middlware with rspec?
I''m thinking something like
rails'' rails/actionpack/test/controller/session/mem_cache_store_test.rb but
with rspec... any thoughts?
Thanks!
Best,
Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
2007 Dec 18
2
rpec_scaffold and nested resources
I''ve got a love-hate relationship with script/generate rspec_scaffold
If you are using non-nested controllers/resources it''s great. I love
the spec skeletons it generates.
But I find myself doing this, where Y is and existing set of
model/controller ... representing a resource:
1) script/generate rspec_scaffold x ....
At this point rake spec passes.
2) edit config/routes.rb
2011 Apr 15
7
warning: toplevel constant XYZ referenced Admin:XYZ
I have an odd problem. I got controllers in a namespace and
controllers outside of the namespace. For example, I have a
PagesController and a Admin::PagesController.
When I run rspec from the top, tests pass and I get the following
warning:
spec/controllers/admin/pages_controller_spec.rb:4: warning: toplevel
constant PagesController referenced by Admin::PagesController
This makes no sense. I do
2011 Jun 09
1
subdomain based namespacing makes RSpec incorrectly state that the route doesn't exist
Hello,
I''m doing namespace routing based on subdomain, rather than path, so
that http://admin.example.com/pages leads to app/controllers/admin/
pages_controller.rb. Cucumber is following this fine, but RSpec is
complaining that the requested route doesn''t exist even though "rake
routes" shows the route. When I add a standard namespace below the
"scope :admin"
2008 Jun 12
1
map.resources :foo_items, :as => :foo confusing my controller specs
I have following resource defined in my config/routes.rb (the model
name is contrived)
map.resources :foo_items, :as => :foo
that I originally generated with rspec_scaffold:
ruby script/generate rspec_scaffold foo_item
but when I use the :as attribute in resources to make the URI path be
''/foo'' instead of ''/foo_items'' the default/generated controller
2008 Nov 06
3
Verifying some understanding about manipulating DB data in before/after callbacks in RSpec
We had an after(:each) callback that looked like this:
PurchaseOrder.find(:all).each {|po|
DraftInvoice.find_all_by_po_number(po.po_number).each {|di| di.destroy}}
which we were hoping would reset some purchase order data in a certain way.
However, because we have "self.use_transactional_fixtures = true" set in
test_helper.rb, this code was never getting committed.
So, I just
2006 Jun 12
2
Database in RoR application
I''m working on a new rails project that will have a very, very large
database. Initial insert will be in the hundreds of thousands of
records.
The database we are getting the information from is Microsoft SQL based,
and we have access to tab delimited update files daily.
We''re trying to write import scripts and use a well designed database on
our end. The data they are
2007 Nov 02
5
RSpec, RESTful nested routes and :path_prefix
Dear list,
In the app we are making we have a rout something like this:
map.resources :projects do |projects|
projects.resources :pages, :controller
=>"Wiki::Pages", :path_prefix => "/projects/:project_id/
wiki", :name_prefix => "project_wiki_"
end
But I can''t get RSpec(I''m very new to it) to accept this. It keeps
throwing errors:
2007 Jul 26
2
rspec_resource error
First of all hi, I''m new to the list, and rather new to rspec as will
probably show in myquestion.
I have tried installing rspec and rspec_on_rails as plugs both using
"script/install" and
"piston import" commands using the "current release install instructions"
here [1]. However,
there doesn''t seem to be any mention of the rspec_resource
2008 Oct 09
1
About received unexpected message :code with (no args)
I use rspec_scaffold to generate a part of examples as below:
it "should expose a newly created awarding_body as @awarding_body" do
AwardingBody.should_receive(:new).with({''these'' =>
''params''}).and_return(mock_awarding_body(:save => true))
post :create, :awarding_body => {:these => ''params''}
2009 Sep 30
10
Can't run specs after upgrading gems... get 0 tests, 0 assertions...
So after I updated all my gems, I started getting:
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/
dependencies.rb:105:in `const_missing'': uninitialized constant
Test::Unit::TestResult::TestResultFailureSupport (NameError)
from /Library/Ruby/Gems/1.8/gems/test-unit-2.0.3/lib/test/unit/
testresult.rb:28
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
2008 Jan 26
0
RSpec and resource_controller plugin
I just discovered James Golick''s resource_controller plugin
http://jamesgolick.com/resource_controller after spending another
stretch of boredom making the changes to nest yet another rails
resource controller. I''d actually slowed down this time to think
about what I was doing in hopes of automating the task.
I''ve tended to use script/generate rspec_scaffold to get
2009 Jan 12
5
Restful Authentication Uninitialized Constant in Production...
rake db:migrate RAILS_ENV=production
rake aborted!
uninitialized constant User::Authentication
The preceding I encounter when attempting to migrate to the production
database. My google powers have escaped me. Everywhere says Restful
Authentication is missing in the production server. However, to
validate this, I attempted this on the same server as the development,
which works.
So, what
2009 Sep 20
11
describe block proc parameter as alternative to before blocks?
I''ve been reading through the Rspec book to see if I missed any
tricks, and the discussion of before block use for context setup in
sec 12.6 struck me as interesting and something I had a knee-jerk
reaction to.
I think that when you are using nested examples to describe a context
change it is bad practice to allow any example within that group to
run outside of that context. This could
2007 Jul 26
5
Coding standards and whitespace
Recently as a result of using Git I''ve noticed a number of
inconsistencies in the RSpec codebase with respect to whitespace
(mixed line endings, mixed use of spaces and tabs for indentation,
and trailing whitespace at the end of lines). I never would have
noticed, but Git produces nice colorized diff output which highlights
these kinds of inconsistencies.
I wanted to ask if the
2009 Oct 14
14
spec-ing private methods?
On Wed, Oct 14, 2009 at 5:49 PM, Scott Taylor <scott at railsnewbie.com> wrote:
>
> On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote:
>
> hello there,
> how do you tipically spec private methods? The thing is ? have something
> like this:
>
> def some_method
> ?? complex_method + other_complex_methods
> end
>
> private
> def complex_method...