similar to: Partial matches in expectations

Displaying 20 results from an estimated 2000 matches similar to: "Partial matches in expectations"

2006 Oct 25
2
Isn''t it possible to stub / expect on :id ?
Hi all ! Running this: @payout = stub_everything(:id => 141) Payout.stubs(:find).with(@payout.id).returns(@payout) Generates this warning: ./test/functional/payouts_controller_test.rb:22: warning: Object#id will be deprecated; use Object#object_id What am I missing ? :id is a fairly frequent method to override in Rails-based applications. I''m using Mocha from
2006 Dec 08
2
Windows Tempfile Fix Plugin
Hi all, Yesterday, I had some problems reading JPG files in my tests. Turns out the problem was that Windows Ruby doesn't set it's Tempfile to work in binary mode. Since I deploy on Linux, that has never been a big problem, but now I'm working on some software that works with binary files exclusively. Anyway, I am making this fix available as a Rails plugin. The details can be
2006 Dec 08
2
Windows Tempfile Fix Plugin
Hi all, Yesterday, I had some problems reading JPG files in my tests. Turns out the problem was that Windows Ruby doesn't set it's Tempfile to work in binary mode. Since I deploy on Linux, that has never been a big problem, but now I'm working on some software that works with binary files exclusively. Anyway, I am making this fix available as a Rails plugin. The details can be
2007 May 17
4
How to mock helpers in view specs ?
Hi all, I am mocking the following Rails view (inside a partial): <%= render :partial => "forums/forum", :collection => forum_category.forums.readable_by(current_user? ? current_user : nil) %> My spec fails with the following message: 1) ActionView::TemplateError in ''forum_categories/index (anonymous user) should only render forums accessible to anonymous
2007 Jan 29
2
Cryptic error message when no controller_name
Hi ! In the following spec: context "A project owner" do specify "can assign roles to other users" do # ... end end I get the following cryptic error message: 1) NoMethodError in ''A project owner can assign roles to other users'' undefined method `session='' for #<Object:0xb741bed4>
2007 Mar 27
1
Ticket #7124
http://dev.rubyonrails.org/ticket/7124 I just attached a patch against 1.2 that cleanly applies to trunk too. This allows functional and integration tests to have the same interface to the xhr/xml_http_request method. The patch also includes a deprecation workaround when called without the appropriate parameters. If the patch could also be applied to the 1.2 branch, I would appreciate. The
2007 Feb 06
2
Testing RJS actions
Hi all ! This is my test: def test_destroy_xhr Article.expects(:find).with("1").returns(@article = mock("article")) @article.expects(:destroy).returns(true) delete :destroy, :id => 1, :format => :js assert_template "destroy.rjs" end And my implementation: def destroy @article.destroy respond_to do |format| format.html {
2007 Apr 06
2
Advantages of using :single_index ?
Hi all, Google returns two results for this: http://www.google.ca/search?q=acts_as_ferret+shared_index+option&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:fr:official&client=firefox-a Both point to the ChangeLog, so I don''t really know if anybody used a shared index. From the RDoc, I know the option makes AAF "use a Ferret index that is shared by all classes..."
2007 Jan 22
1
Observed models cause failures with DRBSpec ?
Hi all ! I don''t believe I am the only one using model observers, right ? Well, here''s a nice one: $ drbspec spec . Finished in 0.125322 seconds 1 specification, 0 failures $ drbspec spec F 1) ''A user with an inactive and an active project should be able to return active projects only'' FAILED [] should == [#<Spec::Mocks::Mock:0xb75590bc
2007 Oct 05
2
Mongrel PID file permissions
Hi ! I''m using Mongrel 1.0.1 with --pid and --user/--group. The PID files are correctly owned by the user/group, but their permissions is 0666. Is that normal ? Shouldn''t it be something like 0664 ? Just curious to know if I''m wrong. Configurator has this (line 77): # Writes the PID file but only if we''re on windows. def write_pid_file if
2006 Sep 08
1
has_many relationship extensions and scoping rules
Hi all ! Is this supposed to work ? class Email < ActiveRecord::Base has_many :to, :class_name => 'Recipient', :conditions => "recipients.source = 'to'" do def create!(*args) with_scope(:create => {:source => 'to'}) do super end end def build(*args) with_scope(:create => {:source => 'to'}) do
2007 Jan 24
7
Differences between assert_tag and assert_select
Hi all, I can't seem to make assert_select work for the more complex cases for me. Here's a sample: # View <%= link_to_remote 'Add new', :url => new_phone_url, :submit => 'phones_head' %> # Generated code: <a href="#" onclick="new Ajax.Request('http://test.host/admin/parties/phone/new', {asynchronous:true, evalScripts:true,
2007 Apr 03
5
Inifinite loop problem with DRb server
Hi all, We''re attempting to use Ferret with the DRb server at the moment, and it doesn''t work, at all... = Executive Summary The DRb server process keeps on calling the remote index to the DRb server process... Which means DRb is calling itself, and itself, and itself, until Ruby kills the Thread with a SystemStackLevel error. = The excruciating details... # Mongrel is
2006 Jul 26
2
ResponseLogger Plugin
http://www.agilewebdevelopment.com/plugins/responselogger From the README: Ever wondered what exactly Rails returned in an RJS response ? Here''s your chance to see it: ===> text/javascript (49 bytes) Element.replace(''target'', ''<em>It works!</em>''); <=== == ResponseLogger Logging the response value is easy. Simply install
2007 Sep 30
2
Outputing to the browser, how?
Hello, I''m writting some helper methods to write forms, so I have this working code: class TableFormBuilder < ActionView::Helpers::FormBuilder ["file_field", "password_field", "text_field"].each do |name| define_method(name) do |label, *args| @template.content_tag(:tr, @template.content_tag(:td, @template.content_tag(:label,
2007 Sep 04
4
Could someone take a look at #9477 (new fieldset_tag helper)?
Hi everyone, I just submitted a patch for a new fieldset_tag helper. It''s helpful and encourages developers to follow web standards, etc. "+1"s welcome :-) http://dev.rubyonrails.org/ticket/9477 Cheers Damian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
2007 Apr 06
0
Problem using a configuration file
Hi all, I''m trying to start Mongrel using a configuration file, but Mongrel complains: $ sudo mongrel_rails start --config /usr/local/www/xltester.com/config/mongrel.yml !!! Path to log file not valid: log/mongrel.log mongrel::start reported an error. Use mongrel_rails mongrel::start -h to get help. I''m using sudo above to replicate monit, not because I run Mongrel as root.
2007 Apr 12
0
Does Ferret have problems with #alias_method_chain ?
Hi all, I have this in my class: class Party < AR::B acts_as_ferret :store_class_name => true, :remote => true, :fields => (self.content_columns.map(&:name) rescue []) + %w(main_identifier) class << self # #count is also defined, omitted for clarity def find_with_destroyed_scope(*args) with_destroyed_scope do
2007 Jan 29
0
mock.with(Hash) expects an Array ?
Hi all, I looked at the open issues on the bug tracker, but couldn''t find anything related to this. I also searched the archives. And I can''t believe someone didn''t hit on this before. Here''s my spec: context "A project owner" do controller_name :roles setup do controller.stub!(:current_user).and_return(@user = mock("user"))
2007 Mar 19
0
PGError "unknown column" on polymorphic association column
Hi all ! This is very strange. I am attempting to get my application running on PostgreSQL (from MySQL), and I get this error: ActiveRecord::StatementInvalid: PGError: ERREUR: la colonne «Party» n'existe pas : SELECT * FROM contact_routes WHERE (routable_type = "Party" AND routable_id = 1000013) ORDER BY position DESC LIMIT 1