简体   繁体   English

RSpec返回0个示例,0个失败

[英]RSpec returns 0 examples, 0 failures

I am new to Rspec. 我是Rspec的新手。 I am writing a test case to cover some action in a model. 我正在编写一个测试用例来涵盖模型中的一些操作。 Here is my rspec code 这是我的rspec代码

test_cover_image_spec.rb 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
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. 意味着您只想运行从第1行开始的行/块。

In your case it's the require 'spec_helper' line, which has no assertions, thus no tests are run. 在你的情况下,它是require 'spec_helper'行,它没有断言,因此没有运行测试。

To run the whole suit, you should run, well, the whole suit: 为了运行整套服装,你应该运行整套服装:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM