Displaying 20 results from an estimated 600 matches similar to: "Spec''ing Namespaced Controllers"
2007 Nov 13
2
More Rails Pattern Examples?
Hi,
I have been reading the documentation and examples on the rspec site.
There are two "patterns" from Rails that I am not clear how to
implement that are kind of related, and so I am not sure how to start.
Does anyone have any examples of how to write rspecs for these?
1/ Nested resources.
2/ Resources that are specific to the current_user. In other words, I
only want to
2007 Jun 02
7
I''m really bad at controllers, help please.
Hey,
Sorry for so many questions - I''m really bad at this right now.
I''m trying to cover the following code w/ rspec
def index
if params[:user_id]
@user = User.find(params[:user_id])
@messages = @user.messages
end
end
So basically what I''m doing is listing all the messages for a user,
provided there is an id parameter.
describe
2010 Jun 10
1
RSpec 2 equivalent for: assigns[:message].should == @message
describe MessagesController, "POST create" do
before(:each) do
@message = mock_model(Message, :save => nil)
Message.stub(:new).and_return(@message)
end
context "when the message fails to save" do
before(:each) do
@message.stub(:save).and_return(false)
end
it "assigns @message" do
post :create
assigns[:message].should
2006 May 31
5
Sharing code between some controllers? Staying DRY
Hi,
I have four controllers: one for the store front and three for the
store admin. In each controller I have copied and pasted exactly the
same code. It is a method called redirect_to() to override Action
Controller''s redirect_to(). Copy and paste is bad. I can think of two
options but I don''t know how Rails will feel about them.
Option 1: Can I create an intermediate
2007 May 23
3
PXE and Security Issues
Hi guys,
im about write a project about pxe. How it works etc but im stucking at
the security thing. Well pxe has this menu password feature using SHA-1,
but since sha-1 is hacked, i cant stick with it saying sha-1 is safe
..etc. What else could i add when it comes to network boot, pxe and
security besides BIS? I would really appricate some ideas or help. Thx
in advance
2015 Jun 30
2
Defining a `show` function breaks the print-ing of S4 object -- bug or expected?
Hi r-devel
If you define a function named `show` or attach a package with an exported
`show` function, then printing/vieweing S4 objects breaks. This is probably
because the `print` function calls `show`, which is now masked.
Example:
show <- function() {}
> setClass("Person", slots = list(name = "character"))
> tom <- new("Person", name =
2016 Apr 05
5
R-dvel [robustness Simulation study of 2 sample test on several combination of factors ]
hi, i am new in this field.
do
favorite<http://stackoverflow.com/questions/36404707/simulation-study-of-2-sample-test-on-different-combination-of-factors#>
If I wish to conduct a simulation on the robustness of two sample test by using R language, is that any ways in writing the code?
There are several factors
(sample sizes-(10,10),(10,25),(25,25),(25,50),(25,100),50,25),(50,100),
2015 Jun 30
0
Defining a `show` function breaks the print-ing of S4 object -- bug or expected?
A slightly simpler formulation of the problem is:
show <- function(...) stop("My show!")
methods::setClass("Person", slots = list(name = "character"))
methods::new("Person", name = "Tom")
#> Error in (function (...) : My show!
Hadley
On Tue, Jun 30, 2015 at 9:02 AM, Dean Attali <daattali at gmail.com> wrote:
> Hi r-devel
>
2004 Mar 15
1
cannot change file permissions
Hi List,
I have some severe problem with Samba 3 with ldapsam
backend on debian stable.
The problem is that I can not change the rights
of a file or directory on the server from Windows.
I get this in smb.log:
---cut---
[2004/03/14 21:59:09, 0] smbd/posix_acls.c:create_canon_ace_lists(1380)
create_canon_ace_lists: unable to map SID
S-1-5-21-2443489570-4015384086-1858331161-3009 to uid or gid.
2015 Jun 30
2
Defining a `show` function breaks the print-ing of S4 object -- bug or expected?
On 30/06/2015 1:57 PM, Hadley Wickham wrote:
> A slightly simpler formulation of the problem is:
>
> show <- function(...) stop("My show!")
> methods::setClass("Person", slots = list(name = "character"))
> methods::new("Person", name = "Tom")
> #> Error in (function (...) : My show!
Just to be clear: the complaint is
2020 Jun 24
0
Converting dot-namespaced Maildir to /-namespaced
I have a couple of domains on my server, all of them namespaced with a
dot. It's 10-15 mailboxes at the most. Is there good way to convert them
to / (slash) namespaced folders? Maybe some bash script lying around
somewhere?
2007 Mar 24
1
RSpec and namespaced controllers
I''m running into a problem with RSpec/Rails and namespaced controllers.
I''ve got a controller called ''TenantsController'' in app/controllers
and another called ''Admin::TenantsController'' in app/controllers/admin
In spec/controllers/, I have a tenants_controller_spec.rb. In
spec/controllers/admin/ I have another tenants_controller_spec.rb.
Both
2008 Mar 01
1
Asking for last +1 for render :parial => @something in namespaced controllers patch
Hello,
http://dev.rubyonrails.org/ticket/9742
If anyone is annoyed by that, please find a moment to review the
patch. It''s rather tiny and tested enough. It still applies cleanly
(r8962) as I write this.
Thanks,
Jacek Becela
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core"
2007 Jul 24
2
Dealing with nested/namespaced classes w/ describe
Hi all,
Just wondering about this: I''ve been dealing with classes/modules
nested in several layers of namespaces. Here would be an example of
a describe block:
describe ClassOne::ClassTwo::ClassThree, "description here" do
...
end
What would be the easiest way to write something a little more terse,
like:
describe ClassThree, "description here" do
...
end
2010 Aug 15
0
Singular resources namespaced by its slug (Routing)
Hi,
I have the followed Rails 3 routes:
Hello::Application.routes.draw do
resources :blogs do
resources :articles do
resources :comments
end
end
end
By raking them, we can find (for instance):
GET /blogs/:blog_id/articles(.:format) {:action=>"index",
:controller=>"articles"}
Because every routes begin with the
2008 Jan 15
0
Namespaced routes and js.erb
Whenever I try and use a .js.erb view in my nested routes it tries to
look for a layout(i.e. admin.js.erb). any ideas on how to stop this
other than calling :layout => false?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2010 Jan 20
0
How to map a Named Route onto a namespaced resource?
I have a site, where I am currently adding a self-built shop.
Among other stuff I have this construction in my route-file
map.namespace :shop do |shop|
shop.resources :categories do |categories|
categories.resources :products
end
end
I like the namespace, since it encapsulates the shop nicely inside my
webapplication.
Somehow I would like the url "http://mysite.com/shop" to
2011 May 30
3
Alternative I18n convention for namespaced models
https://github.com/rails/rails/issues/1402
Can we expect support for that in Rails 3.1.0 ?
Robert Pankowecki
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com.
For
2007 May 31
16
Could anyone please help with rspec/nested resource behavior checking?
My problem has been listed here:
http://railsforum.com/viewtopic.php?pid=25439#p25439
Don''t think it would be required to completely re-type it here :)
Thanks!
--
-Daniel Fischer
http://danielfischer.com - Geek Blog
http://abigfisch.com - Portfolio
http://writersbeat.com - Writing Community
2006 Dec 22
2
Relating Namespaced Models
I am dealing with a large project. I use a lot of STI and therfore have
a lot of models. I''d like to use namespaces to help organize my models
but am having trouble getting started.
I have a base model Term::Base located in /app/models/term/base.rb:
class Term::Base < ActiveRecord::Base
set_table_name "terms"
end
I have a non-namespaced client model:
class Client <