3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Turnipでrequest specやmodel specなどのfeature spec以外のspecを実行する

Last updated at Posted at 2015-01-07

APIサーバーのテストのためにxhrを使おうとしたら出来なかったので・・・。

以下のようにrails_helper.rbに記述するとmodel specやrequest specとして動作させることができるようです。

spec/rails_helper.rb
Turnip.type = :request

typeはspec fileの

RSpec.describe AnyModel, :type => :model do
  #pending "add some examples to (or delete) #{__FILE__}"
end

のtypeと同じものが使えます。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?