add splash screen to the casting calls
This commit is contained in:
@@ -18,7 +18,7 @@ RSpec.describe CastingCallsController, type: :controller do
|
||||
expect(response).to be_successful
|
||||
end
|
||||
|
||||
it "renders content" do
|
||||
it "renders content if there are existing broadcasts" do
|
||||
create(:casting_call, project: project)
|
||||
|
||||
get :index, params: { project_id: project }
|
||||
@@ -36,6 +36,18 @@ RSpec.describe CastingCallsController, type: :controller do
|
||||
expect(response.body).to have_link("2", href: project_casting_calls_path(project, page: 2))
|
||||
end
|
||||
end
|
||||
|
||||
context "when there are no records" do
|
||||
it "renders splash screen" do
|
||||
CastingCall.destroy_all
|
||||
|
||||
get :index, params: { project_id: project }
|
||||
|
||||
expect(response.body).not_to have_content no_casting_calls_message
|
||||
expect(response.body).to have_link create_casting_call
|
||||
expect(response.body).to have_link schedule_demo
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#new" do
|
||||
@@ -117,4 +129,16 @@ RSpec.describe CastingCallsController, type: :controller do
|
||||
def update_params
|
||||
{ description: "This is updated description" }
|
||||
end
|
||||
|
||||
def no_casting_calls_message
|
||||
t 'casting_calls.index.empty'
|
||||
end
|
||||
|
||||
def create_casting_call
|
||||
t 'casting_calls.splash.actions.create_casting_call'
|
||||
end
|
||||
|
||||
def schedule_demo
|
||||
t 'casting_calls.splash.actions.book_demo'
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user