Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rspec3-action

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rspec3-action

  • 2.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Build Status Code Climate

rspec3-action

An extension to rspec, which provides an action command to rspec examples. Forked from rspec-action

Description

rspec-action3 is an extension to rspec3, which allows you to specify the last before hook. I named it action, because it's quite helpful for me in the controller specs.

IMPORTANT Use rspec-action 1.2.0 for Rspec 2.13

Use rspec-action 1.1.0 for Rspec 2.12

Use rspec-action 1.0.0 for Rspec 2.11 or lower.

I prefer to write

describe "GET index" do
  action { get :index }

  context 'if user signed in' do
    before { sign_in user }
    it { should respond_with :success }
  end

  context 'if user signed out' do
    it { should redirect_to sign_in_path }
  end
end

instead of

describe "GET index" do
  context 'if user signed in' do
    before { sign_in user }
    before { get :index }
    it { should respond_with :success }
  end

  context 'if user signed out' do
    before { get :index }
    it { should redirect_to sign_in_path }
  end
end

Requirements

  • rspec3 ~> 3.0

Installation

gem install rspec-action3

FAQs

Package last updated on 15 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc