|
3 | 3 | RSpec.feature "create experiment", type: :feature do |
4 | 4 | scenario "without authorization" do |
5 | 5 | visit new_experiment_path |
6 | | - expect(page).not_to have_content(t('experiments.new')) |
| 6 | + expect(page).not_to have_content(t('experiments.description')) |
7 | 7 | end |
8 | 8 |
|
9 | 9 | scenario "with authorization" do |
10 | 10 | authenticate_as_admin |
11 | 11 | visit new_experiment_path |
12 | 12 | expect(page).to have_content(t('experiments.new')) |
| 13 | + |
| 14 | + screenshot_and_save_page |
| 15 | + |
| 16 | + #### Create experiment |
13 | 17 | title = Faker::Name.last_name |
14 | 18 | description = Faker::TheFreshPrinceOfBelAir.quote |
15 | 19 | fill_in 'experiment_title', with: title |
16 | 20 | fill_in 'experiment_description', with: description |
17 | 21 | find('input[name="commit"]').click |
18 | 22 | expect(Experiment.last.title).to eq(title) |
19 | 23 | 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 | + |
20 | 65 | end |
21 | 66 |
|
22 | 67 |
|
|
0 commit comments