Displaying 20 results from an estimated 900 matches similar to: "Factory_girl association with specific values"
2010 Feb 04
2
preload test data from factory_girl
Is there a way to preload common data made by factory_girl to speed up
tests instead of recreating these common data at the beginning of
every test. For example, I want to have 10 users premade at the
beginning of every test.
I found this http://agilewebdevelopment.com/plugins/factory_data_preloader
But the page says that this plugin does not "play nice" with
autotest. But I use
2013 Feb 28
1
Validation Failed: Userkey has already been taken, Email has already been taken
Hi,
I am using Factory girl with rspec and capybara for testing my rails
appliction. I have the below code
FactoryGirl.define do
factory :user do |f|
f.email "sss1 at gmail.com"
f.userkey "12ssd345q62"
end
end
When I run the test it is failing as "Validation Failed: Userkey has
already been taken, Email has already been taken".
What could be the reason for
2011 Jan 20
11
RSpec / Cucumber painfully slow Rails 3 OSX
I am working on my first Rails BDD project with extensive tests since
starting out with Rails a few years ago.
Running RSpec or Cucumber is really slow. I''m using Rails 3 and RSpec
2.
To run one model spec with only 5 tests takes almost 1 minute! When it
finishes it says it took only 0.9 seconds to run the actual test. So
obviously it is loading the environment that takes so long. I just
2013 Aug 22
1
How do I deal with ActiveRecord::RecordInvalid: Validation failed:
Hello all,
I am currently writing model tests in rails 4. I am attempting to add an
error to a reservation object if the total number of reservations for a
given date and time has reached a pre-determined limit.
When my test runs, it is hitting the appropriate code but it is raising the
following error as opposed to just giving me an error in the object that I
can use.
2010 May 08
2
uninitialized constant - Please Help Me...
Hello everyone,
I''ve decided to take the step into creating a mini-forum for my
website where users can open new posts on exixting topics and allow
people to discuss things etc...
I am following a tutorial in the book: APRESS - Practical Rails Social
Networking Sites and have hit a minor issue.
Part of the Forum requirements is to add a moderator role to allow
only certain individuals
2012 Nov 12
1
Factory girl associations and rspec
Hi,
I am trying to test factory girl associations basically I have a user
model and status model , what is supposed to happen is a user has many
statuses and a status belongs to a user. I have tried to model this in
factory girl as you can see in the files. When I try to execute the test
I get
Failure/Error: visit("/users/#{user.id}/statuses/#{status.id}")
2012 Nov 08
1
validates_uniqueness_of(*attr_names) w scope not working in unit test
Rails 3.2.8
Very strange , it works in dv mode console , but not in a unit test
class User < ActiveRecord::Base
belongs_to :subdomain
validates_uniqueness_of :email, :scope => :subdomain_id
class UserTest < ActiveSupport::TestCase
def initialize_user
@booboo = FactoryGirl.create(:subdomain, name: "booboo")
@coocoo = FactoryGirl.create(:subdomain, name:
2010 Sep 27
3
having some issues with factory_girl and bundler...
Hi All
Need some brilliants minds here :)
I''m using Rails 2.3.8 & ruby 1.8 (I know, I know... )
I''ve move my gems from .gems to Bundler, but I''m having some issues with
Factory_girl when I rake spec
"uninitialized constant Factory"
I''m following the instructions from http://gembundler.com/rails23.html.
Basically:
- grab all config.gem and place
2013 Oct 08
1
Trouble with rspec and FactoryGirl Sequence
I''m following Michael Hartl''s Ruby on Rails 3 Tutorial but I''m using
Rails 3.2.8 and FactoryGirl 4.2.0 and rspec 2.14.1 I''m in chapter 10
trying to generate tests for pagination (using will_paginate 3.2.5 which
works fine in dev)
I can get FactoryGirl to test just fine if I don''t use Sequence but I
can''t seem to figure out the correct syntax
2012 Jun 08
1
[Rails 3.2.5] Rails: unit test fixture_path : fixture_file_upload cannot find the file ...
I am trying to perform a test unit, using FactoryGirl
include ActionDispatch::TestProcess
FactoryGirl.define do
factory :article do
.......
photo { fixture_file_upload ''/files/test.jpg'', ''image/jpg'' }
end
end
IN mt test_helper.rb I defined the fixture_path
def fixture_path
File.dirname(__FILE__) + "/fixtures/" #
2012 Nov 12
7
RSpec: controller POST create
Rails 3.1.3
rspec-rails (2.11.4)
rspec 2.11.1
I am new to rspec. I don''t quite understand tests for POST create part.
I have generated scaffold, and simultaneously it generated
controller_spec.rb as well.
it "assigns a newly created plan as @plan" do
post :create, {:plan => valid_attributes}, valid_session
assigns(:plan).should be_a(Plan)
2010 Dec 09
15
Rails 3 Active Record query returns "undefined method `loaded?' for #<Array:0x126a4c>"
I am getting this error on an rspec test:
undefined method `loaded?'' for #<Array:0x126a4c>
When I call:
Practice.includes("practice_members").all
Practice has_many :practice_members
PracticeMember belongs_to :practice
Practice.all returns:
[#<Practice id: 6, name: "Practice One", created_at: "2010-12-09 15:40:46",
updated_at: "2010-12-09
2004 Feb 08
5
can't access samba server from xp
Hi all,
I just setup my samba server 2.2.8 on Solaris 8 Sparc. I am following
checklist from 'Samba-Howto-Collection.pdf'.
When I run 'net view' from a xp box but got below error message. Could
anyone tell what I need to do ?
---------------------
c:>net view \\smbhost
System error 5 has occured.
Access is denied.
c:>net use x: \\smbhost\tmp
System error 1240 has
2012 Nov 18
3
remarkable activerecord association RSpec
i''m using gem Remarkable activerecord for association. i''ve installed
remarkable and remarkable activerecrod both gem. i''ve added both gem in
my Gemfile. i''ve added "remarkable_activerecord" as required in
spec_helper.rb.
describe Authentication do
FactoryGirl.build(:authentication).should
belong_to(:user)
2013 Jun 18
1
Getting rspec error: Net::SMTPServerBusy: Relay access denied
I''m trying to test registration emails (sent with devise), and I keep
getting the error:
Net::SMTPServerBusy: 454 4.7.1 <model_spec-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org>: Relay access denied
I''m running Rails 3.2.11 with Capybara, and I have (temporarily) chopped my
spec_helper.rb and test.rb files down to the bare minimum, still getting
the error above.
2006 Jan 28
3
Multiple Subscriptions to SIP accounts at Same Domain
Sorry not to have observed etiquet and lurked here for a bit before
wading in with a question but I have an issue that may well be because
I dont know enough about what asterisk is actually doing under the hood
to understand why I cant do what I want with asterisk.
Im hoping that someone can point me in the right direction :-)
This is what I have:
Mandrake 2006 running Asterisk 1.2.3 - no
2010 Jan 26
2
[inter-pbx commnication] trying to make PBX1 talk to PBX2
Hi All,
i want to make an extension from pbx1 able to tlak to another extension from
pbx2 or use pbx2's trunk to dial outside calls.
so i edited in both servers accordinally the iax.conf:
register => pbx1:pass at 172.16.200.175 <pbx1%3Apass at 172.16.200.175>
[pbx2]
type=friend
host=dynamic
trunk=yes
sercret=pass
context=[default] ; i used the biggest context to avoid confusion as
2011 Mar 26
2
Dovecot-2.0.11 searches in all LDAP directory
Hello.
I have some users IDs in different OUs with different passwords. Base OU
for mail server is 'ou=Mail, dc=ph, dc=com'
Trying manual search:
# ldapsearch -b 'ou=Mail, dc=ph, dc=com' -D 'cn=bind, ou=Users, dc=ph,
dc=com' -w XXX -s sub -h mainserv.ph.com
'(&(objectClass=qmailUser)(uid=someuser))' uid mailMessageStore
?
# extended LDIF
?
uid: someuser
2001 Nov 21
1
Samba password issue
Is it possible to have the users password on the Unix end to be
different to that of the Windows client user.
Example:
I have a Windows 2000 user who logs onto his PC as "fredblogs" with a
password of "password1".
On the Unix Samba end I have the user "fredblogs" setup with a password
of "password2".
I am then unable to access the Unix server, if I reset
2005 Jul 02
1
Problem registering Asterisk Dual Server
Here is my configuration everything would seems be straight forward, but
I can not register both asterisk with each other.
Both asterisks have Static IP but they are behind firewall/router, so
it means I have to use Register statement.
I'm a bit confused about the register statement.
How can they can register with each other when both firewalls are
blocking port 4569?
Do I have to open