Cast me sync
This commit is contained in:
114
spec/features/user_managing_casting_calls_spec.rb
Normal file
114
spec/features/user_managing_casting_calls_spec.rb
Normal file
@@ -0,0 +1,114 @@
|
||||
require "rails_helper"
|
||||
|
||||
feature "User managing casting calls" do
|
||||
let(:current_user) { create(:user) }
|
||||
let(:project) { create(:project, account: current_user.primary_account) }
|
||||
|
||||
before :each do
|
||||
sign_in current_user
|
||||
end
|
||||
|
||||
scenario "casting calls table is visible" do
|
||||
visit project_casting_calls_path(project)
|
||||
|
||||
expect(page).to have_content "Created On"
|
||||
expect(page).to have_content "Title"
|
||||
expect(page).to have_content "Status"
|
||||
end
|
||||
|
||||
scenario "sees list of casting calls" do
|
||||
visit project_casting_calls_path(project)
|
||||
|
||||
expect(page).to have_content no_casting_calls_label
|
||||
|
||||
casting_call = create(:casting_call, project: project)
|
||||
|
||||
visit project_casting_calls_path(project)
|
||||
|
||||
expect(page).not_to have_content no_casting_calls_label
|
||||
|
||||
expect(page).to have_content casting_call.created_at.try(:strftime, '%D')
|
||||
expect(page).to have_content casting_call.title
|
||||
expect(page).to have_content casting_call.status
|
||||
end
|
||||
|
||||
scenario "can create casting call requests" do
|
||||
visit project_casting_calls_path(project)
|
||||
|
||||
expect(page).to have_content no_casting_calls_label
|
||||
click_on add_new_casting_call_label
|
||||
|
||||
fill_in title_field, with: "Casting Title"
|
||||
fill_in description_field, with: "Description"
|
||||
fill_in project_description_field, with: "Project Description"
|
||||
fill_in interview_instructions_field, with: "Welcome Message"
|
||||
fill_in interview_requirements_field, with: "Goodbye Message"
|
||||
fill_in questions_field, with: "Questions"
|
||||
|
||||
click_on "Create Casting call"
|
||||
|
||||
expect(page).to have_content("Your casting call request was successfully submitted. Thank you. A chat window will pop up on the lower right in a few seconds.")
|
||||
end
|
||||
|
||||
scenario "can update casting call requests" do
|
||||
create(:casting_call, title: "Title", project: project)
|
||||
visit project_casting_calls_path(project)
|
||||
|
||||
click_on manage_button
|
||||
click_on "Edit"
|
||||
|
||||
fill_in title_field, with: "New Title"
|
||||
|
||||
click_on "Update Casting call"
|
||||
|
||||
expect(page).to have_content("The casting call request has been updated")
|
||||
end
|
||||
|
||||
scenario "can cancel a casting call request" do
|
||||
create(:casting_call, title: "Title", project: project)
|
||||
visit project_casting_calls_path(project)
|
||||
|
||||
click_on manage_button
|
||||
click_on "Cancel"
|
||||
|
||||
expect(page).to have_content("The casting call request has been cancelled")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def no_casting_calls_label
|
||||
"Casting calls will appear here"
|
||||
end
|
||||
|
||||
def manage_button
|
||||
t "casting_calls.casting_call.actions.manage"
|
||||
end
|
||||
|
||||
def add_new_casting_call_label
|
||||
t "casting_calls.index.actions.new"
|
||||
end
|
||||
|
||||
def title_field
|
||||
t "helpers.label.casting_call.title"
|
||||
end
|
||||
|
||||
def description_field
|
||||
t "helpers.label.casting_call.description"
|
||||
end
|
||||
|
||||
def project_description_field
|
||||
t "helpers.label.casting_call.project_description"
|
||||
end
|
||||
|
||||
def interview_instructions_field
|
||||
t "helpers.label.casting_call.interview_instructions"
|
||||
end
|
||||
|
||||
def interview_requirements_field
|
||||
t "helpers.label.casting_call.interview_requirements"
|
||||
end
|
||||
|
||||
def questions_field
|
||||
t "helpers.label.casting_call.questions"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user