2
votes
0answers
75 views

Isolated testing of a presenter nested under a model namespace

I have the following object structure in a Rails app: # app/models/model_a/model_b/model_c.rb class ModelA < ActiveRecord::Base class ModelB < ActiveRecord::Base class ModelC < ...
2
votes
0answers
114 views

Rails engine: rake routes show its routes but on rspec execution “No route matches” is thrown

I'm trying to test a controller that is inside an engine my application is using. The spec is not within the engine, but in the application itself (I tried to test within the engine but also had ...
2
votes
0answers
83 views

rails test unit stubbing and then calling the method via try

I am writing a unit test and for some reason whenever i call the method I am stubbing from a try block it does not return the stubbed results. Is there something special i need to configure in order ...
2
votes
0answers
246 views

Rails: How to mock gems, such as fb_graph

I am using the gem fb_graph. I am new to rails, and am trying to figure out how to mock this gem using rspec. ( https://github.com/nov/fb_graph ) The code I am attempting to test is: facebook_user ...
2
votes
0answers
133 views

How to test a helper method which uses a method created with helper_method?

I have a method in my ApplicationHelper called #login_or_logout_link, which just returns a "log in" or "log out" link depending on whether admin is currently logged in. The method which checks if the ...
1
vote
0answers
49 views

Why is my database empty during rails testing, when it should have at least one entry?

I have a rails server that I'm trying to run tests against using RSpec, Capybara, and Selenium on a mac. I have a command line program that incorporates the library that performs iOS calls and am ...
1
vote
0answers
33 views

TestUnit outdated with Rails 4?

I read that TestUnit was replaced in Ruby 1.9.3 itself with Minitest and that Rails 4 is using MiniTest. Should i move all my testUnit-Tests to Testmini or is this not necessary?
1
vote
0answers
92 views

Rails, SRP, and Unit Tests

Preamble Hey, this is my first time attempting to build an app with SRP in mind and really trying to use tests to drive the code for the site, rather than starting with my data architecture (AR) and ...
1
vote
0answers
37 views

plugin Test case is not running..

I created a rails plugin and I wrote a test case for that, But unfortunately when I run the tests for the plugin my test methods are not executing, and Its not giving an error as well, Following is ...
1
vote
0answers
153 views

How can I speed up Rails unit tests involving image upload/resizing?

My app does a lot with images. I use paperclip to attach them to models. I have tons of tests (Test::Unit) that involve creating images, these run pretty slowly. I use FactoryGirl to create models in ...
1
vote
0answers
65 views

Setting output_buffer in Rails' own tests

I'm writing a testcase against Rails' CacheHelper. To achieve the desired result, I need to be able to set the output_buffer manually. Currently Rails' cache_test.rb test has the following test for ...
1
vote
0answers
142 views

Rails: preserving callbacks when subclassing IntegrationTest

I have a Rails 3 app that uses subdomains to separate different use cases. Normal webapp requests go to www., mobile access goes to m., and requests for the JSON api are directed api.. My ...
1
vote
0answers
706 views

Rails - Test::Unit - testing that number is greater than 0

My post model has a sequence attribute that I want to make sure is numerically greater than 0: class Post < ActiveRecord::Base validates :sequence, :presence => true, ...
1
vote
0answers
144 views

Ruby On Rails: Testing deletes tables

I'm creating an application in RoR and I'm implementing unit testing in all my models. When I run every test on his own (by running ruby test/unit/some_test.rb) all tests are successful. But when I ...
0
votes
0answers
5 views

Testing a controller mapped to a different path

I have a controller SuperPower that is responsible for the paths under /super-power, and not the canonical /super_power (notice the hyphen instead of the underscore). In my routes.rb I have ...

1 2 3 4 5 8
15 30 50 per page