Sha256: 8b199020dd6d8dd7b40cbf7c8e889df65983b3feee224a014fb2a0383131e53e

Contents?: true

Size: 1.39 KB

Versions: 7

Compression:

Stored size: 1.39 KB

Contents

require File.join(File.dirname(__FILE__), 'test_helper')

class Mg::MetricVariantsControllerTest < ActionController::TestCase
  
  test "should get index" do
    get :index, {}, logged_in
    assert_response :success
    assert_not_nil assigns(:metric_variants)
  end

  test "should get new" do
    get :new, { :metric_id => mg_metrics(:two).id }, logged_in
    assert_response :success
  end

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

    assert_redirected_to mg_metric_url mg_metrics(:two)
  end

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

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

  test "should update metric_variant" do
    put :update, { :id => mg_metric_variants(:one).to_param, :metric_variant => { } }, logged_in
    assert_redirected_to mg_metric_url assigns(:metric_variant).metric
  end

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

    assert_redirected_to mg_metric_variants_url
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mountain-goat-1.0.6pre1 test/mg_metric_variants_controller_test.rb
mountain-goat-1.0.5 test/mg_metric_variants_controller_test.rb
mountain-goat-1.0.4 test/mg_metric_variants_controller_test.rb
mountain-goat-1.0.3 test/mg_metric_variants_controller_test.rb
mountain-goat-1.0.2 test/mg_metric_variants_controller_test.rb
mountain-goat-1.0.1 test/mg_metric_variants_controller_test.rb
mountain-goat-1.0.0 test/mg_metric_variants_controller_test.rb