Displaying 19 results from an estimated 19 matches for "machinist".
2009 Jul 21
2
Machinist - having problems stubbing an after_create filter
Hi all
I''m moving to using Machinist in my rspec tests and am having a problem
with an after_create callback method that i need to stub out. It seems
like calling ClassName.make will trigger this callback before i''ve had
the chance to stub it.
Can i stub it in my blueprint for that class? Or, can i stub the method
for all...
2010 Feb 01
3
validating both sides of a has_one relationship breaks pickle/machinist tests
..., I don''t see this issue addressed specifically.
ex:
class Foo
has_one :schedule, :dependent => :destroy
validates_presence_of :schedule
class Schedule
belongs_to :foo
validates_presence_of :foo_id
this creates a circular dependency that breaks test frameworks like
pickle and machinist.
At first I was surprised a little that you can contsruct objects with
this constraint
...you can of course with "new" and "save"
...though I it sounds like the destroy will cause a problem.
http://mohammed.morsi.org/blog/taxonomy/term/29
is there a workaround for tests?
or is...
2010 Jan 29
4
requiring records in the DB before testing
Is there any way I can require a small set of data be in the test
database before any tests are run? (unit, functional, integration,
cucumber, etc)
Any way besides using fixtures, that is.
Overload a rake task?
Modify test_helper?
Any ideas?
(Simple Case: I have to have a minimal set of user roles defined
before any users can be created)
--
You received this message because you are subscribed to
2010 Jun 03
2
creating fixtures for has_many :through
...uperuser)
role: roles(:user)
====
... but no combination of "roles(:user)", "roles(:user).find",
"roles(:user).find.id" etc appears to create the correct associations.
Before Marnen tells me to put aside my Luddite tendencies and that I
should learn factory_girl or Machinist or the next testing framework du
jour, is there any sensible way to do this using fixtures?
- ff
--
Posted via http://www.ruby-forum.com/.
--
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 rub...
2010 Dec 12
5
Fixtures and unit tests - no such file to load
Hello all,
I''m having some issues with my test fixtures and unit tests and am
hoping somebody has an idea about how to fix it.
Background:
I have a table in my legacy database called tp_approval_step.
For this table I have a fixture called tp_approval_step.yml
I have a model called ApprovalProcessStep that uses set_table_name
''tp_approval_step''
In my test file,
2009 Sep 01
13
Function Testing Reloading Fixtures before assertion
Hey Everyone,
I have a function test the is failing (despite the fact the function
actually works in the application). I was looking for some debug
advice on how to find my problem.
Here is the test:
def test_should_delete_word
assert_equal ''published'', words(:one).status
debugger
delete :destroy, :id => words(:one).to_param
assert_equal
2010 Jul 28
5
db:fixures:load does not call Model.save()
Hello,
$ ruby script/generate model balance plus:integer minus:integer
equal:integer
$ cat app/models/balance.rb
class Balance < ActiveRecord::Base
def save
self.equal = self.plus - self.minus
super
end
end
$ cat test/fixtures/balances.yml
_10-1:
plus: 10
minus: 1
$ rake db:fixtures:load
$ sqlite3 db/development.sqlite3
sqlite> select * from balances;
//=>
2009 Jul 20
9
rake error
...etric_fu (1.1.1)
linecache (0.43)
memcache-client (1.7.4)
metaid (1.0)
mini_magick (1.2.5)
mislav-will_paginate (2.3.11)
mocha (0.9.7)
mojombo-chronic (0.3.0)
money (2.1.3)
mongrel (1.1.5)
mysql (2.7)
net-scp (1.0.2)
net-sftp (2.0.2)
net-ssh (2.0.11)
net-ssh-gateway (1.0.1)
nokogiri (1.3.2)
notahat-machinist (1.0.3)
polyglot (0.2.6)
prawn (0.5.0.1)
prawn-core (0.5.0.1)
prawn-format (0.2.0.1)
prawn-layout (0.2.0.1)
rails (2.3.2, 2.2.2)
rake (0.8.7)
rcov (0.8.1.2.0)
RedCloth (4.2.2)
relevance-rcov (0.8.3.4)
rmagick (2.10.0)
rspec (1.2.7)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
ruby_parser (2.0.3)
ru...
2010 Aug 06
4
Object/Record foreign key IDs set to zero
Hello,
Hope no one minds me just jumping in here with a question.
I''m completely new to Ruby on Rails. I''ve been reading "Simply Rails
2", and following their examples. I reached a point where the unit
tests were unexpectedly failing. Upon investigation, I discovered that
when Rails loads the fixtures, the foreign keys aren''t being populated
with the foreign
2009 Jul 21
1
[RAILS] - 2.3.3 creating a sea of red
hello,
I''ve already asked via Rails channels on this and have received no
response, so I''m asking here in hopes someone has run into something
similar.
I updated to rails 2.3.3 yesterday, and now all of my specs are
failing with the following error:
Fixture::FormatError in ''PublishedGallery Methods#thumbnail should
delegate to its lead asset''
a YAML error
2009 Jul 11
3
Migration in Multiple Database
hello to all
I been working on this from past few days.
.I am talking about separate migration for each one of the multiple
database that a single rails application has connection with.I know that
rails can work with multiple databases but what with migrations
for e.g
my main rails application has a connection to two databases
1> main_development
2> secondary_development
Know suppose i
2009 Dec 22
1
Rails fixtures - defining a table name?
Hi,
At the minute all my fixtures have the same name as the table that they
are intended for, because of a recent issue with rails it doesn''t seem
possible to have a fixture beginning with the word ''test''
Does anyone know of a way to have a different fixture name and then map
it to the correct table?
Thanks
--
Posted via http://www.ruby-forum.com/.
--
You received
2011 Feb 07
9
Best way to populate development database
What would be the best way to populate a development database for a
Rails 3 app? I have looked at faker, but it seems that development has
stopped, any other options?
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To
2011 Mar 03
1
Nondestructive testing environment on legacy db
Hi,
I''ve been trying to Google for an answer to this, but the suggestions I''ve
found have been either contradictory or seemingly outdated.
I''m building a Rails frontend for a legacy Oracle database, and I want to do
proper tests with RSpec/Cucumber. What I can''t seem to figure out is how to
run tests without destroying and rebuilding the database.
I''m
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
2020 Jul 08
6
USB-serial adapter for CentOS 7
I need to connect an older APS UPS unit to a machine running CentOS 7. Unfortunately the UPS only has a serial port whereas the computer does not. I am aware that there are USB-serial adapters but that the hardware or the drivers might fall short of expectations.
Does anyone have positive experience with such an adapter? Or, conversely, would recommend avoid a particular adapter?
2010 Dec 06
10
testing chapter: agile web dev withrails
I am working my way through Agile web development with rails and I''m in
the testing chapter.
when I run the following test(or any other test)
I''m new and not sure where to start looking.
require ''test_helper''
class ProductTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
I
2010 Oct 06
7
Passing a hash from the model to the view
I''m trying to display a drop-down menu by using an instance variable
from a model.
THIS WORKS...
<div class="field">
<%= f.label :duration %><br />
<%= f.select ("duration", {"30 minutes" => "30", "1 hour" => "60"},
:prompt => "Select") %>
</div>
THIS DOESN''T
2015 Mar 26
2
[LLVMdev] GSOC project on KCoFI
Hi
In my previous mail I mentioned the project on KCoFI( the control FLow
integrity methods for commodity hardware
http://sva.cs.illinois.edu/pubs/KCoFI-Oakland-2014.pdf ).
Will it be more helpful to the community if I do the improvements number #1
and #3 mentioned in my previous mail to the mailing list or if i try to
port it to arm architecture?
I have decided to go ahead with the improvements