Sha256: a29c299720e5aa761c5a3d23149a658cf273e7028c0cd6e2d6df81482dd5a377

Contents?: true

Size: 1.39 KB

Versions: 20

Compression:

Stored size: 1.39 KB

Contents

require 'spec_helper'

describe Rearview::DashboardsController do

  before do
    sign_in_as create(:user)
    @routes = Rearview::Engine.routes
  end

  context "GET /dashboards" do
    it "renders the index view" do
      get :index, format: :json
      render_template(:index)
    end
  end

  context "GET /dashboards/:id" do
    it "renders the show view" do
      app = create(:dashboard)
      get :show, id: app.id, format: :json
      render_template(:show)
    end
  end

  context "GET /dashboards/:id/errors" do
    it "renders the errors view" do
      app = create(:dashboard)
      get :errors, id: app.id, format: :json
      render_template(:errors)
    end
  end

  context "POST /dashboards" do
    it "renders the create view" do
      app = build(:dashboard)
      post :create, JsonFactory::Dashboard.create(app)
      render_template(:create)
    end
  end

  context "PUT /dashboards/:id" do
    it "renders the update view" do
      app1 = create(:dashboard)
      app2 = build(:dashboard)
      params = JsonFactory::Dashboard.create(app2) do |json|
        json["id"]=app1.id
        json["userId"]=app1.user_id
      end
      put :update, params
      render_template(:update)
    end
  end

  context "DELETE /dashboards/:id" do
    it "renders the destroy view" do
      app = create(:dashboard)
      delete :destroy, id: app.id, format: :json
      render_template(:destroy)
    end
  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rearview-1.2.0-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.1.2-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.1.1-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.1.0-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.3.rc.4-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.3.rc.3-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.3.rc.2-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.3.rc.1-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.2-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.2.rc.4-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.2.rc.3-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.2.rc.2-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.2.rc.1-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.1-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.0-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.0.rc5-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.0.rc4-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.0.rc3-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.0.rc2-jruby spec/controllers/dashboards_controller_spec.rb
rearview-1.0.0.rc1-jruby spec/controllers/dashboards_controller_spec.rb