Displaying 7 results from an estimated 7 matches for "hayafirst".
2009 Mar 19
6
[Cucumber 0.2] Failure to use should
I have a step definition like this:
Then "the account should be created" do
account = Account.find_by_name("my shiny new account")
p account.class
account.should_not be_blank
end
When running this step, I got the error message:
Account(id: integer, name: string, state: string, next_renewal_at: date,
created_at: datetime, updated_at: datetime, full_domain: string,
2009 Feb 25
4
wrong number of arguments (2 for 1)
The following statement gave me "wrong number of arguments (2 for 1)" and it
is the only error. no stack trace.
presenter.stub!(:account).and_return account
any idea? Thanks
Yi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090225/8e667eea/attachment.html>
2007 Mar 30
7
problem with using any_instance
Hey all,
I have a question with using mocha in my tests.
In the same test file, I have two tests,
<code>
def test_a
klass.any_instance.stubs(:method_name).returns("something")
klass.new.method_name
...
end
def test_b
...
klass.new.method_name
...
end
</code>
where klass is some class
when the tests run, test _a passes, but test_b had an error like this:
2008 Jun 20
15
before_save model callback rspec testing
hi all,
i''m learning rspec and i can''t figure out how to test if a callback is
executed in a model.
my model code is:
class User < ActiveRecord::Base
before_save :encrypt_password
...
def encrypt(password)
self.class.encrypt(password, salt)
end
thanks a lot,
cs.
--
Posted via http://www.ruby-forum.com/.
2008 Jun 24
1
Story HTML output
Hi,
If I write the HTML format stories output to
~/ccrb_build-build_number/Stories/index.html. To get all styles
rendered, I also need to copy
/vendor/plugins/rspec/story_server/prototype/stylesheets/ and
/vendor/plugins/rspec/story_server/prototype/javascripts/ to the
~/ccrb_build-build_number/Stories/.
Just wonder is this the right way to do it? or there is a
better/preferred way? Thanks
Yi
2009 Jun 26
0
validates_uniqueness_of and MySQL enum type
I tried to check validates_uniqueness_of for a MySql enum type column
with a scope given, like this:
validates_uniqueness_of :phone_type, :scope => :user_id
And It didn''t work. When I check the SQL statement for doing this
validation, it is like this:
SELECT `phone_numbers`.id FROM `phone_numbers` WHERE
(`phone_numbers`.`phone_type` = BINARY '''' AND
2008 May 23
3
RailsExampleGroup
So I have a describe which is a subclass of RailsExampleGroup. I inserted
some data into my database, and reconnect! my connection. Before reconnect,
finding the data I just created is fine. The data cannot be found, after
reconnection, the data is gone. It''s not in the database. It looks to me the
data is not actually inserted into the DB at all, just somehow buffered
somewhere. Would