Skip to content

Commit 85230dd

Browse files
committed
begin of implementation of test for Create Experiment
1 parent 4802288 commit 85230dd

1 file changed

Lines changed: 46 additions & 1 deletion

File tree

evaluationserver/spec/features/create_experiment_spec.rb

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,65 @@
33
RSpec.feature "create experiment", type: :feature do
44
scenario "without authorization" do
55
visit new_experiment_path
6-
expect(page).not_to have_content(t('experiments.new'))
6+
expect(page).not_to have_content(t('experiments.description'))
77
end
88

99
scenario "with authorization" do
1010
authenticate_as_admin
1111
visit new_experiment_path
1212
expect(page).to have_content(t('experiments.new'))
13+
14+
screenshot_and_save_page
15+
16+
#### Create experiment
1317
title = Faker::Name.last_name
1418
description = Faker::TheFreshPrinceOfBelAir.quote
1519
fill_in 'experiment_title', with: title
1620
fill_in 'experiment_description', with: description
1721
find('input[name="commit"]').click
1822
expect(Experiment.last.title).to eq(title)
1923
expect(Experiment.last.description).to eq(description)
24+
25+
#### create scenes
26+
27+
authenticate_as_admin
28+
29+
visit scenes_path
30+
expect(page).to have_content(t('scenes.new'))
31+
32+
click_link(t('scenes.new'))
33+
34+
expect(page).to have_content(t('scenes.name'))
35+
expect(page).to have_content(t('scenes.description'))
36+
expect(page).to have_content(t('scenes.remarks'))
37+
expect(page).to have_content(t('scenes.mapping'))
38+
39+
scene_name = Faker::Name.last_name
40+
scene_description = Faker::TheFreshPrinceOfBelAir.quote
41+
scene_remarks = Faker::TheFreshPrinceOfBelAir.quote
42+
scene_mapping = Faker::TheFreshPrinceOfBelAir.quote
43+
scene_url = "http://www.example.com"
44+
45+
fill_in 'scene_name', :with => scene_name
46+
fill_in 'scene_description', :with => scene_description
47+
fill_in 'scene_remarks', :with => scene_remarks
48+
fill_in 'scene_mapping', :with => scene_mapping
49+
fill_in 'scene_url', :with => scene_url
50+
51+
find('input[name="commit"]').click
52+
53+
expect(page).to have_content(scene_name)
54+
expect(page).to have_content(scene_description)
55+
expect(page).not_to have_content(scene_remarks)
56+
expect(page).not_to have_content(scene_mapping)
57+
expect(page).to have_content(scene_url)
58+
59+
60+
visit steps_path
61+
expect(page).to have_content(t('steps.steps'))
62+
expect(page).to have_content(t('new'))
63+
64+
2065
end
2166

2267

0 commit comments

Comments
 (0)