require_relative 'rails_helper'
require 'spec_helper'
RSpec.feature "testCreateVideo", :type => :feature do
context 'create new video 'do
scenario "Successfully creates a new video" do
visit "https://SomeURL/orders"
within('form') do
fill_in "order[organisation][name]", :with => "SAMPLE BRAND NAME"
fill_in "order[organisation][website]", :with => "SAMPLE WEBSITE"
select "option", from: "select box", :with => "Singapore"
select "option", from: "select box", :with => "Central"
choose('order[project][name]', option: 'time_frame_next_week')
choose('order[project][budget]', option: 'up-to-five')
fill_in "#order_project_description", with: 'sample description'
fill_in "order[project][videos_we_like_tmp]", :with => "My Widget"
fill_in "order[contact][first_name]", :with => "John Christian"
fill_in "order[contact][last_name]", :with => "Dela Pena"
fill_in "order[contact][email]", :with => "christianmamac08@gmail.com"
fill_in "order[contact][mobile]", :with => "65 8134 9249"
check('accepts_terms')
end
click_button ('button')
expect(page).to have_text("Thank you for creating your quote.")
end
scenario "should fail creating video" do
visit "https://someURL/orders"
within('form') do
#fill_in "order[organisation][name]", :with => "SAMPLE BRAND NAME"
fill_in "order[organisation][website]", :with => "SAMPLE WEBSITE"
select "option", from: "select box", :with => "Singapore"
select "option", from: "select box", :with => "Central"
choose('order[project][name]', option: 'time_frame_next_week')
choose('order[project][budget]', option: 'up-to-five')
fill_in "#order_project_description", with: 'sample description'
fill_in "order[project][videos_we_like_tmp]", :with => "My Widget"
fill_in "order[contact][first_name]", :with => "John Christian"
fill_in "order[contact][last_name]", :with => "Dela Pena"
fill_in "order[contact][email]", :with => "christianmamac08@gmail.com"
fill_in "order[contact][mobile]", :with => "65 8134 9249"
check('accepts_terms')
end
click_button ('button')
expect(page).to have_text("Brand Name is missing.")
end
end