krishna krishna - 2 months ago 31
Ruby Question

RSpec returns 0 examples, 0 failures

I am new to Rspec. I am writing a test case to cover some action in a model. Here is my rspec code

test_cover_image_spec.rb

require 'spec_helper'

describe Issue do

before :each do
@issue = Issue.joins(:multimedia).uniq.first
binding.pry
end

describe '#release_cover_image' do
context 'While making an issue open' do
it 'should make issue cover in S3 accessible' do
put :update, :id => @issue.id, :issue => @issue.attributes = {:open => '1'}

end
end
end
end

Answer
rspec ./spec/models/issues/issue_cover_release_spec.rb:1

means you only want to run a line/block, that starts on the line 1.

In your case it's the require 'spec_helper' line, which has no assertions, thus no tests are run.

To run the whole suit, you should run, well, the whole suit:

 rspec ./spec/models/issues/issue_cover_release_spec.rb