Sha256: 3974f8dc6f34ac85206e77e41247464d86b06e03968346b1657b850b459bf66d

Contents?: true

Size: 1.38 KB

Versions: 19

Compression:

Stored size: 1.38 KB

Contents

require 'test_helper'

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

  test "should get new" do
    get :new, { :ocelot_metric_id => metrics(:two).id }, admin_user
    assert_response :success
  end

  test "should create metric_variant" do
    assert_difference('MetricVariant.count') do
      post :create, { :metric_variant => { :metric_id => metrics(:two).id, :name => 'var', :value => 'cool' } }, admin_user
    end

    assert_redirected_to ocelot_ocelot_metric_url metrics(:two)
  end

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

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

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

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

    assert_redirected_to ocelot_ocelot_metric_variants_url
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

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