Displaying 20 results from an estimated 2000 matches similar to: "Bug in should_not_be - What else to use?"
2006 Oct 24
2
1 should be 2. huh?
There''s another quirk I wanted to bring up. It''s about the failure
message with should_equal and should_be.
x.should_equal 2
a.should_not_be nil
When they fail they yield messages like:
1 should equal 2
nil should not be nil
When I''m caught off guard, which can be often, these messages confuse
me. 1 should equal 2? No it shouldn''t. nil should not be
2007 Feb 01
3
should_redirect_to in rspec-0.8.0 / rspec_on_rails 1453
I have a spec:
specify "a post with no user id should add a record" do
post :edit_or_create, :user => {:login => ''joeschmoe'', :email =>
''joe at shmoe.com'', :email_confirmation => ''joe at shmoe.com'', :full_name
=> ''Joe Schmoe''}
assigns[:user].should_not_be_nil
2007 Jun 11
2
Testing create in Rails controller
Hi All
So I am a first-time caller ;-) ... and have been trying to apply
RSpec to the depot example in Dave Thomas'' book as I build the
application.
I am having a problem testing the admin controller create method and
cannot quite see where I am going wrong so was hoping for a pointer :-)
My spec looks like:
describe AdminController do
before(:each) do
@product =
2007 Feb 02
7
Coming Soon...
Dear spec''ers,
As many of you already know, we''re gearing up for a pretty big 0.8
release of RSpec in the next couple of weeks. I''m writing in advance
because I want to give you a heads up about upcoming changes and how
they may impact your existing specs.
Two important things to note first:
1. We will provide a translator that you''ll be able to use to
2007 Feb 13
16
Error against latest trunk while testing via spec for model
Hi
I just did an update to lates trunk
=================
context "Given a generated venue_spec.rb with fixtures loaded" do
fixtures :venues
specify "fixtures should load two Venues" do
Venue.should have(2).records
end
end
==================
gives me
==========
1)
TypeError in ''Given a generated venue_spec.rb with fixtures loaded
fixtures should load two
2017 Jan 25
1
Clamping down on mailbox sizes...
In that scenario, what actually happens? Does mail get stored? Or rejected? Or delayed?
Jeff
> On Jan 24, 2017, at 6:54 PM, Roger Klorese <rogerklorese at gmail.com <mailto:rogerklorese at gmail.com>> wrote:
>
> I'd take the opposite approach and tell them no new mail will be received until they are under quota.
> On Tue, Jan 24, 2017 at 4:52 PM SH Development
2011 Jul 25
6
What does using a lambda in rspec tests accomplish?
Here is the code in question:
describe UsersController do
render_views
…
…
describe "POST to ''create'' action" do
describe "failure" do
before(:each) do
@attr = { :name => '''', :email => '''', :password => '''',
:password_confirmation =>
2019 Mar 10
2
Assistance with doveadm backup...
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
What version are you using?
</div>
<div>
<br>
</div>
<div>
Aki
</div>
<blockquote type="cite">
<div>
On 10 March 2019 00:40 SH Development via dovecot <
<a
2007 Jul 26
6
response.should_not redirect_to
Hey,
May be it is just too deep night over here and I''m missing something
though I got this failure on {{{response.should_not redirect_to}}}:
''QueuesController should allow authenticated user to access ''show''''
FAILED
Matcher does not support should_not.
See Spec::Matchers for more information
about matchers.
Also I''ve found this in
2019 Mar 10
2
Assistance with doveadm backup...
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
You should upgrade 2.2 first.
</div>
<div>
<br>
</div>
<div>
Aki
</div>
<blockquote type="cite">
<div>
On 10 March 2019 10:45 SH Development via dovecot
2007 May 30
9
Specify attr_protected
This is kind of a two part question.
Question One: I want to be sure that an Order model is protecting
sensitive attributes from mass assignment.
The example looks like this:
describe Order do
it "should protect total attribute from mass assignment" do
@order = Order.new(:total => 0.05)
@order.total.should_not == 0.05
end
end
And the code to implement it:
class Order
2007 May 19
2
have_text matcher does not support should_not.
Hello Guys,
Doing conversion of some test for some controllers, still with integrated views.
Anyway, I have this:
it "should not see Join This Group button on profile page as member" do
get "show", :id => @group.id
response.should be_success
response.should_not have_text(/Join This Group/)
end
But running with spec (0.9.4), drop me the folling error:
2007 Nov 01
3
autotest debugger?
Hi,
I keep facing problems with autotest, and I don''t know what''s happening
in the background, is there anyway to know what''s happening while
testing?
Example:
@user = User.new
@user.email = "testcom"
@user.errors.on(:email).should_not be_empty
...throws error failure
- You have a nil object when you didn''t expect it!
- You might have expected an
2009 Feb 28
7
be_valid (validates_format_of ..., :on => :create)
Greetings,
How to write Example which will check if model''s variable''s
format is valid using :on => :create, like this:
class User < ActiveRecord::Base
...
validates_format_of :email, :with => /.../, :on => :create
...
Using following code is not right:
it "should ..." do
@user = users(:example_user)
@user.email =
2017 Jan 25
3
Clamping down on mailbox sizes...
I don?t want to do this for all users?.but?
I have a few users who insist that they use their mailboxes regularly and don?t want it cancelled. Fine. But they won?t clean them out either.
What steps would you all recommend for setting quotas on some users but not others?
Specifically starting out with identifying WHICH accounts have excessive amounts of crap in them, by age, then sending them
2019 Mar 11
2
Assistance with doveadm backup...
Ok, so for lack of any other information, am I to conclude that the doveadm backup command is broken in 2.0.9? I have been through the wiki for it back and forth and cannot make it work.
Yes, I need to upgrade, there is no question, but I won?t do that without a maildir backup. I would prefer to use the built-in dovecot mechanisms for that than something else.
Jeff
> On Mar 10, 2019, at
2018 Dec 13
2
Re: Panic…
Shouldn't an event of this type trigger a useful warning instead of a cryptic programming error?
On Thu, Dec 13, 2018 at 07:42, Timo Sirainen <tss at iki.fi> wrote:
> On 13 Dec 2018, at 7.31, SH Development <listaccount at starionline.com> wrote:
>>
>> I have started getting these in my log. What does this mean and what do I need to do?
>>
>> Panic:
2007 Jan 04
8
Common setup code and naming specifications
Hello!
I have a lot of contexts for testing Rails controllers, that must do
something like ''session[:logged_in] = true'' in their setup. How can this
be refactored? In unit tests I would simply create a
LoggedInControllerTest base class, that all my functional tests would
derive from.
And another small question:
In my controller specifications I often have to decide whether to
2007 Dec 30
6
Restful-Authentication Rspec Failure Rails 2.0.2
I am trying the Restful-Authentication (latest version, downloaded
today) and upon running the generator, doing the migration, prepping
the test system and putting the resources in routes.rb I get a Rspec
test failure:
''SessionsController logins and redirects'' FAILED
expected not nil, got nil
routes.rb has:
map.resources :users
map.resources :sessions
nothing else was
2007 Sep 20
4
alias :calling :lambda
Sprinkling my examples with ''lambda'' has always seemed like a bit of a
wart to me. I''ve gotten into the habit of adding ''alias :calling
:lambda'' to my spec suites. My examples then look like:
calling { Foo }.should raise_error
calling { Bar }.should_not raise_error
Is there a reason that RSpec core has chosen not to make exception
expectations more