Module: E2eModule

Included in:
Specfac::CLI
Defined in:
lib/specfac/modules/e2e_module.rb

Class Method Summary collapse

Class Method Details

.createObject



63
64
65
# File 'lib/specfac/modules/e2e_module.rb', line 63

def self.create

end

.destroyObject



71
72
73
# File 'lib/specfac/modules/e2e_module.rb', line 71

def self.destroy

end

.editObject



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/specfac/modules/e2e_module.rb', line 76

def self.edit
  "describe 'edit' do
  before do
    @#{Utils.si} = create(:#{Utils.si})
    visit edit_#{Utils.si}_path(@#{Utils.si})
  end
  it 'has an edit page that can be reached' do
    expect(page.status_code).to eq(200)
  end
  it 'can be edited' do

    # fill_in '#{Utils.si}[date]', with: '#{Date.today}'
    # fill_in '#{Utils.si}[rationale]', with: 'Edited Content'
    #
    # click_on 'Submit'
    #
    # expect(page).to have_content('Edited Content')
  end
end"
end

.indexObject

end to end testing



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/specfac/modules/e2e_module.rb', line 6

def self.index
  "describe 'index' do
  before do
    visit #{Utils.pl}_path
  end
  it 'can be reached successfully' do
    expect(page.status_code).to eq(200)
  end

  it 'has a title of #{Utils.si}s' do
    expect(page).to have_content('#{Utils.si}s')
  end

  it 'has a list of #{Utils.si}s' do
    create(:#{Utils.si})
    create(:second_#{Utils.si})
    visit #{Utils.si}s_path
    expect(page).to have_content(#{Utils.si_ca}) # change this
  end
end"
end

.newObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/specfac/modules/e2e_module.rb', line 43

def self.new
  "describe 'new' do
    before do
      visit new_#{Utils.si}_path
    end
    it 'has a new page that can be reached' do
      expect(page.status_code).to eq(200)
    end

    it 'can be created from new form page' do
      # fill_in '#{Utils.si}[date]', with: '#{Date.today}'
      # fill_in '#{Utils.si}[rationale]', with: 'Some Rationale'
      #
      # click_on 'Submit'

      # expect(page).to have_content('Rationale')
    end
  end"
end

.showObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/specfac/modules/e2e_module.rb', line 28

def self.show
  "describe 'show' do
  before do
    @#{Utils.si} = create(:#{Utils.si})
    visit #{Utils.si}_path(@#{Utils.si})
  end
  it 'has a show page that can be reached' do
    expect(page.status_code).to eq(200)
  end
  it 'has content' do
    # expect(page).to have_content('Content')
  end
end"
end

.updateObject



67
68
69
# File 'lib/specfac/modules/e2e_module.rb', line 67

def self.update

end