similar to: Mocking and stubbing Rails'' association extensions

Displaying 20 results from an estimated 3000 matches similar to: "Mocking and stubbing Rails'' association extensions"

2012 Jan 17
4
Gapless Support
Hi, i?m not part of the FLAC project, but i have a question regarding FLAC and Gapless support I hope, I get an answer from some of you ;-) We are currently try to add Gapless support on our device If we rip an CD with our device, we can find out, that one track follow after another so we can recognize, that the tracks are gapless or not. But how can we find that out on already existing
2004 Aug 06
2
AW: AW: final question: how many mountpoints can icecast handle ?
Hello Michael damn, I was afraid of that, but thanks for lightening me up (although I am in complete darkness now, after having seen the light just some days ago..) I'm looking into http streaming of the static files just now, but I came to find that there is one huge drawback: 1. when sending the stream out with icecast/shoutcast it would be possible to "push" the next song
2007 Jun 23
2
type image submit tags on IE dropping the params
I have noticed that on IE, the @params[:commit] does not come through on image submit tags, but it does when the image is removed. this fails: <%= submit_tag( "Schedule", {:type => "image", :src=>"/images/buttons/schedulecard.gif", :alt=>"Schedule Card", :class=>"button"})%> but this works: <%= submit_tag(
2005 Sep 16
0
Max value for table having 2 joins
Hello there, I''m stuck! I''m trying to write a mini app to track versions of songs that have been sent out to members. I have the following tables/models: songs/song has_many :releases versions/version has_and_belongs_to_many :members belongs_to :songs members/member has_and_belongs_to_many :versions songs ===== Song1 Song2 Song3 members ======= John Paul George Ringo
2006 Jun 07
2
How to send post data with link_to_remote?
Hi, I''m trying to send a post body with my link_to_remote call. Prototype supports the ''postBody'' option, but I can''t seem to get link_to_remote to set that. Here''s what I''m trying: link_to_remote ''move up'', :url => { :controller => ''upload'', :action => ''position_ajax'', :id
2007 Jun 22
1
nested rest URL => passing param from select
Hi, I''m trying to create a select box with an onchange event. When onchange is fired, I want to redirect to a nested rest url. The problem is that I don''t know how to pass the selected value to the url: <select id="category" onchange=" <%= remote_function(:url => category_articles_path(selected value?) ) %> "> Any suggestions? -- Posted
2007 Oct 25
1
Mocking/Stubbing help with subdomain as account key
My app uses account_location to set up subdomains as account keys. In my controllers, all my model operations are scoped through the @current_person object. The question is: How do I test this with RSpec''s mocking and stubbing? Basically, I need to test that @current_person.things is getting the find message and returning @thing. I''ve tried stubbing and mocking
2007 Jun 23
7
rake db:migrate strange behaviour "wrong number of arguments (1 for 0)"
Hi everybody, May be somebody has a clue, why I get these errors below, while trying to migrate. Any help is very appreciated! Greetinx Rafael I was trying to experiment a litte bit with redMine (www.redmine.org). But I can only install it locally. On a system with already a mongrel_cluster running, I get strange errors, already while trying to start the migration rake db:migrate
2007 Mar 22
1
Flac encoding of 88.2kHz files -- not streamble?
Hi. I'm trying to encode some high sample rate music (88.2kHz) into flac. When trying this with flac 1.1.4 I get the following error: ##### keithr@eng:~$ work/flac-1.1.4/src/flac/flac Serenissima02.wav <snip copyright> Serenissima02.wav: WARNING: legacy WAVE file has format type 1 but bits-per-sample=24 Serenissima02.wav: WARNING: skipping unknown sub-chunk 'fact'
2006 Nov 10
3
Stubbing Time.now in trunk
I''m a big fan of stubbing Time.now so it returns a known value. I used to be able to use stubba and say: @time_now = Time.parse("Jan 1 2001") Time.stubs(:now).returns(lambda{@time_now}) However, something in trunk broke that. Fine, rspec''s got its own stubbing lib now, so I tried switching to that: @time_now = Time.parse("Jan 1 2001")
2007 Oct 05
7
Easy AR association stubbing
I''ve added a method to the mock class that makes it pretty easy to stub associations in rails. I''ve been using it for awhile and it seems to cut down on a lot of setup code for the controller and model specs that use associations. #before @person = mock_model(Person) posts = mock(''post_proxy'') posts.stub!(:build).and_return(mock_model(Post, :save => true))
2008 Jan 30
2
Stubbing controller methods vs model methods
I had an error that I couldn''t figure out, then when writing up a question for the forum I figured it out. The thing is I don''t understand why the change that was made works and why what existed before didn''t. Here is the initial post when I had the error: ---------------------------------- In the controllers/application.rb file I have a method that finds the account
2003 Oct 17
5
Samba Connection Problem
I've just set up samba for a small LAN. I'm running samba 2.2.7 on RH 8. Now I have a real problem that I have no clue on. I have VERY intermittent connectivity to the Samba server. If I left a computer (Windows 98) idle for a while, and then try to browse the contents in the Samba server, I will get this error " domain is unavailable" or "The specified network name is no
2007 Oct 19
3
Stubbing a Kernel method?
Is it possible to stub a Kernel method? I''m specifically interested in the ''open'' method to test some code using open-uri. I''ve tried: Kernel.should_receive(:open).with(''filename'').and_return(''data'') However, this doesn''t seem to work. Any suggestions would be appreciated. --Paul
2007 Jun 15
6
problem getting started with stubbing in rails controller specs
Hello, Ingo! I''m copying your question to a new e-mail instead of replying to try to keep message threads separate. Have you tried setting up your expectation before issuing the get statement? For example, take this out of the setup block: get ''index'', :locale => ''en'' and move it after:
2007 May 17
2
Stubbing authentication across multiple controllers
Hi, I''m new to RSpec, so I''m not too sure of the best practises in stubbing. I was thinking along the lines of including a helper method that would stub out a users id and posts to sessions/create. It works fine when speccing SessionsController, but of course it fails when it is included into other controllers specs, because of the post. I''ve tried posting to an
2000 Nov 15
3
netbios-ns/udp server failing
Why am I getting the following error mesage? Nov 15 07:52:00 e250 inetd[679]: netbios-ns/udp server failing (looping), servic e terminated ks -------------- next part -------------- HTML attachment scrubbed and removed
2007 Jul 05
6
mocking methods in the controller.
Hi, I''m very new to rspec so please be patient with me. I''ve tried to take some of my tests out of the controller specs to check for things that are rendered. This has not worked so well, since my views have the controller method current_user in quite a few places. Is there any way that I can define this so that my views will be executed? Will this same thing occur for all
2006 Dec 21
3
Stubbing an instance method on a class
Hi all, I''m not sure if I''ve missed it, but I couldn''t find any docs for stubbing an instance method on a class. For example: class Foo; end Foo.stub!(:my_instance_method).and_return(nil) The reason (I think) I need this is because a certain class (Test::Unit::TestCase) expects an argument (name of method) to new and throws an exception if that instance method
2008 May 10
4
Newbie: lambda do...end.should change(Model, :count).by(1). Doesn''t work
Hi to everyone, I''m an RSpec, and BDD in general, newbie so in order to learn I have chosen to use my personal website as a tesbed. I''m having difficulties juggling with mocks, and in particula with the following code. Here''s the controller action: def create @album = Album.new(params[:album]) if @album.save flash[:notice] = "album saved"