Sha256: 6c6fd934244a147d7e227ddf1a293dee495eebe0730b93ecb9ab1d77dbaab7cd

Contents?: true

Size: 796 Bytes

Versions: 11

Compression:

Stored size: 796 Bytes

Contents

require 'spec_helper'

describe SiblingsController do
  describe "GET index" do
    it "assigns all siblings to @siblings" do
      sibling = stub_model(Sibling)
      Sibling.stub(:all) { [sibling] }
      get :index
      expect(assigns(:siblings)).to eq([sibling])
    end
  end
  describe "#deploy" do
    before :each do
      sibling = stub_model(Sibling)
      Sibling.stub(:find) { sibling }
    end
    it "redirects if deploy succeeds" do
      Sibling.any_instance.stub(:deploy).and_return(true)
      post :deploy, id: 1
      response.should redirect_to(siblings_deploys_path)
    end
    it "redirects if deploy fails" do
      Sibling.any_instance.stub(:deploy).and_return(false)
      post :deploy, id: 1
      response.should redirect_to(siblings_deploys_path)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
g5_sibling_deployer_engine-0.7.0 spec/controllers/siblings_controller_spec.rb
g5_sibling_deployer_engine-0.6.3 spec/controllers/siblings_controller_spec.rb
g5_sibling_deployer_engine-0.6.2 spec/controllers/siblings_controller_spec.rb
g5_sibling_deployer_engine-0.6.1 spec/controllers/siblings_controller_spec.rb
g5_sibling_deployer_engine-0.5.0 spec/controllers/siblings_controller_spec.rb
g5_sibling_deployer_engine-0.4.2 spec/controllers/siblings_controller_spec.rb
g5_sibling_deployer_engine-0.4.1 spec/controllers/siblings_controller_spec.rb
g5_sibling_deployer_engine-0.4.0 spec/controllers/siblings_controller_spec.rb
g5_sibling_deployer_engine-0.3.3 spec/controllers/siblings_controller_spec.rb
g5_sibling_deployer_engine-0.3.2 spec/controllers/siblings_controller_spec.rb
g5_sibling_deployer_engine-0.2.6 spec/controllers/siblings_controller_spec.rb