I have a user model and a follower model, such that a user can have many followers. So in schema of follower model I have user_id column and a follower_by_user_id column. So in follower model a user ...

I'm using FactoryGirl, following along with "Everyday Rails with Rspec," and I've gotten stuck on associations. Specifically, I have these controller specs which are failing.
describe "POST #create" ...

I'm in section 7.1.3 of Michael Hartl's Rails Tutorial and I can't get FactoryGirl to work correctly in testing. It doesn't appear to be a problem with FactoryGirl because I also tried creating a User ...

I'm trying to get in the habit of writing specs. However, this is becoming increasingly frustrating. Assume I have two simple models: User and Story. Each model uses a belongs_to relation. Each model ...

I need to generate random latitude and longitude values in my factories for testing, but using Random class gives me duplicate values and make my tests fail, how can I generate random float values in ...

I am trying assign an array of a new public and private key to a variable for each instance so I can generate a unique and matching bitcoin address and signature.
I am using the bitcoin-ruby gem to ...

I'm testing my API, build with Grape and Rails, with RSpec and get a lot of uniqueness validation errors.
I'm using config.use_transactional_fixtures = true to rollback the database after each test, ...

I have a model called Photo that has a Paperclip attachment called image.
I have working specs testing the creation of a new Photo with attachment and can create them manually.
I have the following ...

Putting aside arguments on whether or not you should test existence of a model's associations, I have a model called Order and I am validating that it has at least one item in its has_many association ...

Today, i've encountered a really strange issue with my specs. When i runs a spec command without specifying any specific dir/file, my tests are working great, all green. However, if i'll specify a dir ...