aboutsummaryrefslogtreecommitdiffstats
path: root/test/system/resource_types_test.rb
blob: 54fc45f6fbeb5bd21151f40bbba99c4fcde1aa43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require "application_system_test_case"

class ResourceTypesTest < ApplicationSystemTestCase
  setup do
    @resource_type = resource_types(:one)
  end

  test "visiting the index" do
    visit resource_types_url
    assert_selector "h1", text: "Resource types"
  end

  test "should create resource type" do
    visit resource_types_url
    click_on "New resource type"

    fill_in "Name", with: @resource_type.name
    click_on "Create Resource type"

    assert_text "Resource type was successfully created"
    click_on "Back"
  end

  test "should update Resource type" do
    visit resource_type_url(@resource_type)
    click_on "Edit this resource type", match: :first

    fill_in "Name", with: @resource_type.name
    click_on "Update Resource type"

    assert_text "Resource type was successfully updated"
    click_on "Back"
  end

  test "should destroy Resource type" do
    visit resource_type_url(@resource_type)
    click_on "Destroy this resource type", match: :first

    assert_text "Resource type was successfully destroyed"
  end
end