Displaying 20 results from an estimated 200 matches similar to: "Rspec teting API."
2011 Sep 09
3
Missing Content-Length header breaks ActiveResource 3.1 on create
Hi,
I''ve recently moved a 3.0 app ta 3.1 and am finding that
ActiveResource breaks after a successful post because we now check for
the presence of the Content-Length header[1] after a successful create
(basically whenever the API returns a 201). The API is also on 3.1,
and this only happens on staging/pre-prod/prod.
I''m still investigating, but one thing that is clear is that
2011 Sep 07
4
rspec testing inheritance
Hello,
Is there any way to test model inheritance in spec?
something like..
it { ChildModel.should < ParentModel }
thanks.
2009 Apr 30
1
error with test:functionals
Hello there,
I working on my tests but I getting this strange errror:
I can see on the database that the object was created but I still got
an failure on my test.
this is my test code:
test "should create artist" do
assert_difference(''Artist.count'', difference = 1) do
post :create, :artist => { }
end
assert_redirected_to
2007 May 08
3
assert_difference eval magic in [6693]
I just saw Marcel''s change to assert_difference that changes the
method API to take a string param that is evaled in a lambda.
http://dev.rubyonrails.org/changeset/6693
I much preferred the old API, since it''s simple enough to pass a
lambda. Passing a string means the lambda is in the wrong scope and
doesn''t have access to objects in the test case scope.
For an
2006 Dec 04
5
should_be_different -- possible implementation
There is an assert_difference helper for Test::Unit (you can read
about it at http://blog.caboo.se/articles/2006/06/13/a-better-
assert_difference and to some it should look familiar -- you know who
you are :), so I took a shot at one for rSpec on Rails.
class Object
def should_be_different(method = nil, difference = nil)
return self.should_not_eql(yield) if method.nil?
2006 Aug 06
2
assert_difference gives undefined method error in unit tests
Hi there
Am hitting undefined method errors for ''assert_difference'' in my unit
tests under Rails 1.1.4
What could I be missing?
Richard Sandilands
2007 Oct 17
1
Problem with assert_difference
Hello Friends,
I have problem with assert_difference, I want its syntax and
explantion in detail, Please help me, plz give me solution.
Regards,
Kiran Polawar
--~--~---------~--~----~------------~-------~--~----~
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
2009 Aug 27
2
error sys_lseek copy file samba 2.2.7
I can?t copy some files from server to directory /adawork/softtek om AIX box
I?m using AIX 5.3 with samba 2.2.7-4
Here?s mys logs from samba server
_________________________________________
file log.windows-server
seek_file: (FAT_ATRASO_TRANS_5_3_1_in.txt) sys_lseek failed. Error was Invalid argument
[2009/08/27 13:30:59, 3] smbd/error.c:error_packet(94)
error string = Invalid argument
2012 May 22
0
functional tests assert_difference with array
given a new partner instance and a new admin instance are created,
what should be the difference number : +1 or +2
the doc is not so clear on it....
assert_difference [ ''Partner.count'', ''Admin.count'' ], +1 do...
thanks for feedback
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to
2013 Mar 07
1
Should ActiveRecord::RecordNotSaved attach the record in question?
I''m doing some work where I want to rescue ActiveRecord::RecordNotSaved
from a save! call nested deep in the code. The thing is there could
theoretically be failures here I want to pass through, and I want to
inspect the record in order to decide.
I figure a custom initializer on the exception class and a couple quick
patches here and there in the code would make it minimally
2012 Jul 27
3
Rspec: How to mock class method
Hi, I have two model: Message, User
message.rb
```
class Message < ActiveRecord::Base
class << self
def method_a(args)
[1,2]
end
end
end
```
user.rb
```
class User < ActiveRecord::Base
def method_user
if Message.method_a(''anythings'')
#... some code
end
end
end
```
I want to test method_user,but I don''t want to test
2024 Oct 11
1
Compressed archives randomly corrupted on a Linux share
>
> => many protocols from different clients (Windows 7 and 10 and Debian 9,
> 10 and 12) : SMB2_02, SMB2_10, SMB3_11, NT1
A long time ago, we had a problem with oplocks causing system hangs. It
COULD be related, and I think we ended up downgrading the kernel to 4.9.
https://bugzilla.kernel.org/show_bug.cgi?id=198349#c42
But I've since upgraded to OMV 6+ without any problems.
2013 Jul 17
5
Why last doesn't return an ActiveRecord::Relation
Hello,
Sorry if this has been still answered, I haven''t found nothing on it. I
would love to know why ActiveRecord::Base#last doesn''t return an
ActiveRecord::Relation just like all or where since an
ActiveRecord::Relation can act more or less like an array (as specified here<https://github.com/rails/rails/commit/0a6833b6f701c8c8febadfe2f45e25df29493602>
)?
Thanks, have
2012 May 23
1
received unexpected message :id= with (20)
Please help me to understand this error message:
1) PostsController#create when logged in should create a new post and
redirect to a successful message page
Failure/Error: post ''create'', { post: {title: ''New post'',
Mock Post(id: integer, title: string, description: text,
location: string, created_at: datetime, updated_at: datetime, status:
string,
2013 Dec 19
1
Samba 4.1.2 invalid zero invocationID
Hello,
I had configured a domain with samba 4.1.0rc2, I was able to add a new
server as DC successfull on this version, but after upgrade to 4.1.2, we
have this error:
*Analyze and apply schema objects*
*Partition[CN=Configuration,DC=geribello,DC=com,DC=br] objects[402/1654]
linked_values[0/0]*
*Refusing replication of object containing invalid zero invocationID on
attribute 13 of CN=Deleted
2012 Nov 28
1
Help setting optimization problem to include more constraints
Dear R-helpers,
I am struggling with an optimization problem at the moment and decided to
write the list looking for some help. I will use a very small example to
explain what I would like to. Thanks in advance for your help.
We would like to distribute resources from 4 warehouses to 3 destinations.
The costs associated are as follows:
Destination
>From 1 2 3 Total
2018 Jul 24
1
Re: [PATCH] v2v: rhv plugin - fix DC search string
On Tue, Jul 24, 2018 at 7:27 PM Richard W.M. Jones <rjones@redhat.com>
wrote:
> On Tue, Jul 24, 2018 at 07:16:10PM +0300, Daniel Erez wrote:
> > Search for DC by 'storage.name=' to make it explicit.
> > I.e. "storage=" uses regex, so similar names can be
> > found in the search query. For example, searching for
> > a domain named FCSD, will find
2019 May 24
2
FW: Weird Samba/CIFS behavior: client hangs
I think a network trace would tell us for use whether the server is
responding or not.
You can follow the instruction here to make one:
https://wiki.samba.org/index.php/Bug_Reporting#cifs.ko
--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
2010 Apr 05
1
`test': wrong number of arguments (1 for 2) (ArgumentError)
Hi,
Im trying to change the syntax of my tests to the
test "some method" do
...
end
syntax from the existing
def test_some_method
...
end
syntax. Im pasting my test code below. Im getting the error in the
subject line if I try to run the test as a ruby script from the
console.
require File.dirname(__FILE__) + ''/../test_helper''
require
2014 Feb 11
0
Cucumber test question
Hello all,
I am trying to understand when I try to run a test in cucumber what I am
missing that it is failing. I am using FactoryGirl to create my records and
using cucumber to test my logic however I know that I am doing something
wrong in my testing I just can't seem to figure out what. Here is what I
have:
Feature:
Feature: All features related to staff info
Scenario: notification