Sha256: 40d153d4f8f55e5c56b0a245b0256068010b99a6fb6dfaa69ac54e7e65acc17e

Contents?: true

Size: 1.29 KB

Versions: 19

Compression:

Stored size: 1.29 KB

Contents

require 'test_helper'

class Ocelot::OcelotMetricsControllerTest < ActionController::TestCase
  test "should get index" do
    get :index, {}, admin_user
    assert_response :success
    assert_not_nil assigns(:metrics)
  end

  test "should get new" do
    get :new, { :ocelot_convert_id => converts(:one).id }, admin_user
    assert_response :success
  end

  test "should create metric" do
    assert_difference('Metric.count') do
      post :create, { :metric => { :metric_type => 'geoff', :title => 'hayes', :convert_id => converts(:two).id } }, admin_user
    end

    assert_redirected_to ocelot_ocelot_metric_url :id => assigns(:metric).id
  end

  test "should show metric" do
    get :show, { :id => metrics(:one).to_param }, admin_user
    assert_response :success
  end

  test "should get edit" do
    get :edit, { :id => metrics(:one).to_param }, admin_user
    assert_response :success
  end

  test "should update metric" do
    put :update, { :id => metrics(:one).to_param, :metric => { } }, admin_user
    assert_redirected_to ocelot_ocelot_metric_url :id => assigns(:metric).id
  end

  test "should destroy metric" do
    assert_difference('Metric.count', -1) do
      delete :destroy, { :id => metrics(:one).to_param }, admin_user
    end

    assert_redirected_to ocelot_ocelot_metrics_url
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
mountain-goat-0.1.8 test/ocelot_metrics_controller_test.rb
mountain-goat-0.1.7 test/ocelot_metrics_controller_test.rb
mountain-goat-0.1.6 test/ocelot_metrics_controller_test.rb
mountain-goat-0.1.5 test/ocelot_metrics_controller_test.rb
mountain-goat-0.1.4 test/ocelot_metrics_controller_test.rb
mountain-goat-0.1.3 test/ocelot_metrics_controller_test.rb
mountain-goat-0.1.2 test/ocelot_metrics_controller_test.rb
mountain-goat-0.1.1 test/ocelot_metrics_controller_test.rb
mountain-goat-0.1.0 test/ocelot_metrics_controller_test.rb
mountain-goat-0.0.20 test/ocelot_metrics_controller_test.rb
mountain-goat-0.0.19 test/ocelot_metrics_controller_test.rb
mountain-goat-0.0.18 test/ocelot_metrics_controller_test.rb
mountain-goat-0.0.17 test/ocelot_metrics_controller_test.rb
mountain-goat-0.0.16 test/ocelot_metrics_controller_test.rb
mountain-goat-0.0.15 test/ocelot_metrics_controller_test.rb
mountain-goat-0.0.14 test/ocelot_metrics_controller_test.rb
mountain-goat-0.0.13 test/ocelot_metrics_controller_test.rb
mountain-goat-0.0.12 test/ocelot_metrics_controller_test.rb
mountain-goat-0.0.11 test/ocelot_metrics_controller_test.rb