Persist few records in tests

parent b0035042
......@@ -3,10 +3,13 @@
require 'spec_helper'
RSpec.describe "projects/dast_site_profiles/edit", type: :view do
let_it_be(:site_profile) { create(:dast_site_profile) }
let_it_be(:site_profile_gid) { ::URI::GID.parse("gid://gitlab/DastSiteProfile/#{site_profile.id}") }
before do
@project = create(:project)
@site_profile = create(:dast_site_profile)
@site_profile_gid = ::URI::GID.parse("gid://gitlab/DastSiteProfile/#{@site_profile.id}")
assign(:project, site_profile.project)
assign(:site_profile, site_profile)
assign(:site_profile_gid, site_profile_gid)
render
end
......@@ -15,7 +18,7 @@ RSpec.describe "projects/dast_site_profiles/edit", type: :view do
end
it 'passes project\'s full path' do
expect(rendered).to include @project.path_with_namespace
expect(rendered).to include site_profile.project.path_with_namespace
end
it 'passes DAST profiles library URL' do
......@@ -23,8 +26,8 @@ RSpec.describe "projects/dast_site_profiles/edit", type: :view do
end
it 'passes DAST site profile\'s data' do
expect(rendered).to include @site_profile_gid.to_s
expect(rendered).to include @site_profile.name
expect(rendered).to include @site_profile.dast_site.url
expect(rendered).to include site_profile_gid.to_s
expect(rendered).to include site_profile.name
expect(rendered).to include site_profile.dast_site.url
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment