similar to: Model validation failing in rspec for unknown reason

Displaying 20 results from an estimated 11000 matches similar to: "Model validation failing in rspec for unknown reason"

2008 Aug 25
21
How much test data to use in specs
I''m not sure how much test data I should be using in my specs. I''m writing specs for the Property model in my Rails app. Its "address" attribute is going to be validated with this regex: /\A\d+[a-z]? [-'', a-z]{2,128}\Z/i At the moment, my plan is to spec out the following possibilities. A property is invalid if its address: 1) doesn''t begin with
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}")
2010 Mar 22
2
a "simple" statistic question
Hi, Please suggest a method to answer below questions: Factory_ID Factory_Location Factory_Size Total_Sample Good_Sample Fair_Sample Bad_Sample ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1 City_A
2011 Jan 17
4
Factory Girl and attr_accessor with validation
I have a problem with a recent change to one of my models when created via Factory.create. class User < ActiveRecord::Base attr_accessor :tc_check validates :tc_check, :presence => true, :acceptance => true ... end The following definition fails, when calling Factory.create(:valid_user) Factory.define :valid_user, :class => User do |u| u.email
2010 Sep 25
3
Factory_girl association with specific values
Hope this should be simple: I have a User model and a Role model. Factories for each. When I create a User using FG, I want to assign a specific role. Cant seem to figure out how to do this, getting errors like: uninitialized constant SysadminRole for doing things this way: Factory.define :user do |u| u.practice_id { |a| a.association(:practice).id } u.password ''password1''
2012 Oct 08
2
Graphs using R
Dear, I have a table with four columns similar to the following: Factory Name Production type Months Freq Factory 1 Car type 1 Jan. 0 Factory 1 Car type 2 Feb. 1 Factory 2 Car type 3 May 3 I need help in producing graphs; 1. I
2010 Aug 16
3
Load dummy data using Factory girl
Hello, I wanted to know how to load dummy data in the application using Factory girl. I had done this using Fixtures.I had made a fixtures folder into the test folder and run the command "rake test fixtures:load" Currently i tried using factories in the spec which is working fine. Wanted to know know regarding loading dummy data. -- Posted via http://www.ruby-forum.com/.
2008 Mar 17
4
RSpec''ing model association callbacks
Hi all, i''m learning rspec and i must admit i really love it. But at the time i started learning it, i already developed my models classes and their callbacks. Now i''m trying to get a 100% coverage of my code but i cannot reach it because i do not understand how to spec my callbacks. Look at this for example: ----------------- User Model class User < ActiveRecord::Base
2013 Mar 26
0
Pluralization with default_locale not working (Rails 4 Beta 1)
Hi, I am just trying to setup an application in Rails 4, Beta 1. The application is (exclusively) in German Language and therefore also the URLs should be German. I want to create a controller and model for an entity called "Region"; Rails pluralizes that to "Regions", but it should be "Regionen". What I did is: in config/application.rb uncomment this line:
2011 Sep 07
6
FactoryGirl doesnt produce unique names?!
Hey, I got following very simple test case: require ''spec_helper'' describe Country do it "should create a new instance given valid attributes" do Factory(:country) end end Factory looks like: Factory.sequence :country_name do |n| "Country #{n}" end Factory.define :country do |c| c.name Factory.next(:country_name) c.nationality "Foo
2013 Mar 28
0
Can not determine issue in my factories with factory girl in rspec
Hi Folks, I hope you''re doing good. Sorry for a long email. I am just trying my best to learn something new and, need your help to understand/ sort a small issue which I am not able to figure out. I have create couple of factories and created some examples for rspec for one of my projects. I have got everything working on my local. Even, my specs are green on local for both ruby
2019 Oct 15
5
Zorg migration to GitHub/monorepo
Hello everyone, We are in the middle of porting the majority of zorg to GitHub/monorepo. The following build factories will be ported and if you use one of those for your bots, you are all covered: * ClangBuilder.getClangCMakeBuildFactory (31 bots) * ClangBuilder.getClangCMakeGCSBuildFactory (2 bots) * LibcxxAndAbiBuilder (23 bots) * SphinxDocsBuilder (7 bots) * UnifiedTreeBuilder (11
2019 Oct 29
2
Zorg migration to GitHub/monorepo
I think what she is referring to was that the build seemed to be triggered by a commit to a project that shouldn't trigger builds on a libcxx bot (i.e. the change was in llvm). I have a somewhat orthogonal but related question. In the past, commits to compiler-rt did not trigger builds on llvm/clang/sanitizer bots. Has this behaviour been rectified with the move to github? I am really sorry
2006 Jul 05
0
Association and legacy database
hi all, I''m stuck with this: in environment.rb I have: Inflector.inflections do |inflect| inflect.plural /istituto/, ''istituti'' inflect.plural /Istituto/, ''Istituti'' inflect.irregular ''Istituto'', ''Istituti'' inflect.irregular ''istituto'',
2011 Jul 25
7
Adding a folder to my rspec execution path
Hi guys, I''m using RSpec with Capybara, and for that I created the spec/integration folder. But when I execute the command "bundle exec rspec spec" RSpec don''t execute my files on integration folder. I need to pass each file to solve this problem. Do you known how I can put the integration folder on rspec execution path without need to pass each file? Thanks, Pablo
2009 Jan 27
2
[RSpec] Error when returning multiple values from a stub
Hey guys. I''ve just found some odd behaviour within RSpec 1.1.12 , and would like to know whether this is a bug, or I''m doing something wrong. When I give multiple return values to a stub, like this: SubtitleFile.stub!(:new).and_return @sf1, @sf2 RSpec complains: Mock ''SubtitleFile_1001'' received unexpected message :size with (no args) However, if I
2019 Oct 28
2
Zorg migration to GitHub/monorepo
Hi Galina, It seems that our libcxx bots are now triggering builds for any changes to llvm: http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-aarch64-linux/builds/2434 Should I file a bug report for this? Thanks, Diana On Sat, 19 Oct 2019 at 11:36, Galina Kistanova via cfe-commits <cfe-commits at lists.llvm.org> wrote: > > Hello everyone, > > The staging master is
2015 Jun 10
2
[LLVMdev] Contributing a buildbot for the BPF backend
Hello Marco, Welcome aboard! slaves.py keeps the build slaves definitions, builders.py keeps the builders definitions. You have to have both. The steps of adding a new slave is here: http://llvm.org/docs/HowToAddABuilder.html. Please make sure you done the step # 10 before bringing your slave up, otherwise it wouldn't be authorized by the master and will be blacklisted after multiple
2010 Jul 08
3
my web app seed data and cucumber
I''m writing a web app which is used a SaS. Each customer has their own db and app directory. I have a rake task which creates all necessary minimum data to run their website: default rights and roles, a superadmin user, a "us_states" table already populated, some local depots and terminals (it''s a logistics app). I don''t have any cucumber scenarios for it and
2011 Jul 22
1
rails3 tutorial: testing with factories
I''m having trouble understanding what the assigns() method does, as described at the following link: http://ruby.railstutorial.org/chapters/modeling-and-viewing-users-two#sec:better_user_views The User model has been ''rake db:test:prepare''ed, but I checked and no records were copied to the test db after doing that. Yet the description of assigns() says that the code: