What’s the difference between RSpec and Cucumber? [closed]

RSpec and Cucumber are both testing frameworks. RSpec includes traditional Unit Testing (which means testing a class or part of the application in isolation from the rest of the application. So your model does what your model is supposed to do, the controller does what it is supposed to do, etc). RSpec and Cucumber both … Read more

Skip callbacks on Factory Girl and Rspec

I’m not sure if it is the best solution, but I have successfully achieved this using: FactoryGirl.define do factory :user do first_name “Luiz” last_name “Branco” #… after(:build) { |user| user.class.skip_callback(:create, :after, :run_something) } factory :user_with_run_something do after(:create) { |user| user.send(:run_something) } end end end Running without callback: FactoryGirl.create(:user) Running with callback: FactoryGirl.create(:user_with_run_something)

How to find which rspec test is taking so long

In RSpec 2 and 3, you can use the –profile flag or add –profile to your .rspec file. This will track the top 10 slowest examples. For RSpec 1, you can use –format o with spec command. It shows a text-based progress bar with profiling of 10 slowest examples. For more details see this. rspec … Read more

RSpec vs Cucumber (RSpec stories) [closed]

If you haven’t already, you might want to check out Dan North’s excellent article, What’s in a Story? as a starting point. We have two main uses for Cucumber stories. First, because the story form is very specific it helps focus the product owner’s articulation of the features he wants built. This is the “token … Read more

How to set request headers in rspec request spec?

You should be able to specify HTTP headers as the third argument to your get() method as described here: http://api.rubyonrails.org/classes/ActionDispatch/Integration/RequestHelpers.html#method-i-get and here http://api.rubyonrails.org/classes/ActionDispatch/Integration/Session.html#method-i-process So, you can try something like this: get ‘/my/path’, nil, {‘HTTP_ACCEPT’ => “application/json”}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)