Skip to content

Commit

Permalink
Replace rendered_component to rendered_content
Browse files Browse the repository at this point in the history
Signed-off-by: Rubhan Azeem <rubhanazeem@gmail.com>
  • Loading branch information
rubhanazeem committed Jun 3, 2022
1 parent 3f06c69 commit f127c61
Show file tree
Hide file tree
Showing 22 changed files with 208 additions and 195 deletions.
Expand Up @@ -8,19 +8,19 @@
end

it do
expect(rendered_component).to have_text("Mark all as 'Read'")
expect(rendered_content).to have_text("Mark all as 'Read'")
end

it do
expect(rendered_component).to have_selector(:css, 'a[href="my/notifications?update_all=true"]')
expect(rendered_content).to have_selector(:css, 'a[href="my/notifications?update_all=true"]')
end

it do
expect(rendered_component).to have_text("Mark selected as 'Read'")
expect(rendered_content).to have_text("Mark selected as 'Read'")
end

it do
expect(rendered_component).to have_text('Select All')
expect(rendered_content).to have_text('Select All')
end
end

Expand All @@ -31,19 +31,19 @@
end

it do
expect(rendered_component).to have_text("Mark all as 'Unread'")
expect(rendered_content).to have_text("Mark all as 'Unread'")
end

it do
expect(rendered_component).to have_selector(:css, 'a[href="my/notifications?type=read&update_all=true"]')
expect(rendered_content).to have_selector(:css, 'a[href="my/notifications?type=read&update_all=true"]')
end

it do
expect(rendered_component).to have_text("Mark selected as 'Unread'")
expect(rendered_content).to have_text("Mark selected as 'Unread'")
end

it do
expect(rendered_component).to have_text('Select All')
expect(rendered_content).to have_text('Select All')
end
end
end
Expand Up @@ -12,7 +12,7 @@
end

it 'renders a div containing only the target project and package names' do
expect(rendered_component).to have_selector('div.smart-overflow', text: 'project_123 / package_123')
expect(rendered_content).to have_selector('div.smart-overflow', text: 'project_123 / package_123')
end
end

Expand All @@ -29,7 +29,7 @@
end

it 'renders a div containing only the target project' do
expect(rendered_component).to have_selector('div.smart-overflow', text: 'project_12345', exact: true)
expect(rendered_content).to have_selector('div.smart-overflow', text: 'project_12345', exact: true)
end
end

Expand All @@ -48,7 +48,7 @@
end

it 'renders a div containing the source and target project/package names' do
expect(rendered_component).to have_selector('div.smart-overflow', text: 'source_project_123 / source_package_123project_123 / package_123')
expect(rendered_content).to have_selector('div.smart-overflow', text: 'source_project_123 / source_package_123project_123 / package_123')
end
end

Expand All @@ -63,7 +63,7 @@
end

it 'renders a div containing only the target project and package names' do
expect(rendered_component).to have_selector('div.smart-overflow', text: 'project_123 / package_123')
expect(rendered_content).to have_selector('div.smart-overflow', text: 'project_123 / package_123')
end
end

Expand All @@ -79,7 +79,7 @@
end

it 'renders a div containing only the target project and package names' do
expect(rendered_component).to have_selector('div.smart-overflow', text: 'project_123 / package_123')
expect(rendered_content).to have_selector('div.smart-overflow', text: 'project_123 / package_123')
end
end

Expand All @@ -93,7 +93,7 @@
end

it 'renders a div containing the project name' do
expect(rendered_component).to have_selector('div.smart-overflow', text: 'my_project')
expect(rendered_content).to have_selector('div.smart-overflow', text: 'my_project')
end
end

Expand All @@ -108,7 +108,7 @@
end

it 'renders a div containing the project and package names' do
expect(rendered_component).to have_selector('div.smart-overflow', text: 'my_project_2 / my_package_2')
expect(rendered_content).to have_selector('div.smart-overflow', text: 'my_project_2 / my_package_2')
end
end
end
14 changes: 7 additions & 7 deletions src/api/spec/components/notification_avatars_component_spec.rb
Expand Up @@ -17,11 +17,11 @@
end

it 'renders an extra avatar for other users involved' do
expect(rendered_component).to have_selector('li.list-inline-item > span[title="1 more users involved"]')
expect(rendered_content).to have_selector('li.list-inline-item > span[title="1 more users involved"]')
end

it 'renders an avatar for each user up to the limit MAXIMUM_DISPLAYED_AVATARS' do
expect(rendered_component).to have_selector('li.list-inline-item > img', count: 6)
expect(rendered_content).to have_selector('li.list-inline-item > img', count: 6)
end
end

Expand All @@ -45,23 +45,23 @@
end

it "renders an avatar for the BsRequest's creator with the avatar title being the creator's real name" do
expect(rendered_component).to have_selector('li.list-inline-item > img[title="Johnny Dupuis"]', count: 1)
expect(rendered_content).to have_selector('li.list-inline-item > img[title="Johnny Dupuis"]', count: 1)
end

it "renders an avatar for a group review with the avatar title being the group's title" do
expect(rendered_component).to have_selector('li.list-inline-item > img[title="Canailles"]', count: 1)
expect(rendered_content).to have_selector('li.list-inline-item > img[title="Canailles"]', count: 1)
end

it "renders an avatar for a user review with the avatar title being the user's real name" do
expect(rendered_component).to have_selector('li.list-inline-item > img[title="Jane Doe"]', count: 1)
expect(rendered_content).to have_selector('li.list-inline-item > img[title="Jane Doe"]', count: 1)
end

it "renders an avatar for a package review with the avatar title being the package's project and name" do
expect(rendered_component).to have_selector('li.list-inline-item > span[title="Package project1/package1"]', count: 1)
expect(rendered_content).to have_selector('li.list-inline-item > span[title="Package project1/package1"]', count: 1)
end

it "renders an avatar for a project review with the avatar title being the project's name" do
expect(rendered_component).to have_selector('li.list-inline-item > span[title="Project project2"]', count: 1)
expect(rendered_content).to have_selector('li.list-inline-item > span[title="Project project2"]', count: 1)
end
end
end
16 changes: 8 additions & 8 deletions src/api/spec/components/notification_filter_component_spec.rb
Expand Up @@ -14,16 +14,16 @@

['Unread', 'Read', 'Comments', 'Requests', 'Incoming Requests', 'Outgoing Requests'].each do |filter_name|
it "displays a '#{filter_name}' filter" do
expect(rendered_component).to have_link(filter_name)
expect(rendered_content).to have_link(filter_name)
end
end

it "doesn't display project filters" do
expect(rendered_component).not_to have_css('h5', text: 'Projects')
expect(rendered_content).not_to have_css('h5', text: 'Projects')
end

it "doesn't display group filters" do
expect(rendered_component).not_to have_css('h5', text: 'Groups')
expect(rendered_content).not_to have_css('h5', text: 'Groups')
end
end

Expand All @@ -40,18 +40,18 @@

['Unread', 'Read', 'Comments', 'Requests', 'Incoming Requests', 'Outgoing Requests'].each do |filter_name|
it "displays a '#{filter_name}' filter" do
expect(rendered_component).to have_link(filter_name)
expect(rendered_content).to have_link(filter_name)
end
end

it 'displays project filters' do
expect(rendered_component).to have_css('h5', text: 'Projects')
expect(rendered_component).to have_link(project.name)
expect(rendered_content).to have_css('h5', text: 'Projects')
expect(rendered_content).to have_link(project.name)
end

it 'displays group filters' do
expect(rendered_component).to have_css('h5', text: 'Groups')
expect(rendered_component).to have_link(group.title)
expect(rendered_content).to have_css('h5', text: 'Groups')
expect(rendered_content).to have_link(group.title)
end
end
end
Expand Up @@ -10,9 +10,9 @@
end

it 'displays a link with the active class and containing a badge of the light color' do
expect(rendered_component).to have_css(link_selector, text: 'Comments')
expect(rendered_content).to have_css(link_selector, text: 'Comments')

expect(rendered_component).to have_css("#{link_selector} span.badge.badge-light", text: 20)
expect(rendered_content).to have_css("#{link_selector} span.badge.badge-light", text: 20)
end
end

Expand All @@ -25,9 +25,9 @@
end

it 'displays a link with the active class, but without a badge' do
expect(rendered_component).to have_css(link_selector, text: 'home:Admin')
expect(rendered_content).to have_css(link_selector, text: 'home:Admin')

expect(rendered_component).not_to have_css("#{link_selector} span.badge")
expect(rendered_content).not_to have_css("#{link_selector} span.badge")
end
end

Expand All @@ -40,9 +40,9 @@
end

it 'displays a link without the active class, but containing a badge of the primary color' do
expect(rendered_component).to have_css(link_selector, text: 'iron_maiden')
expect(rendered_content).to have_css(link_selector, text: 'iron_maiden')

expect(rendered_component).to have_css("#{link_selector} span.badge.badge-primary", text: 10)
expect(rendered_content).to have_css("#{link_selector} span.badge.badge-primary", text: 10)
end
end

Expand All @@ -55,9 +55,9 @@
end

it 'displays a link without the active class and a badge' do
expect(rendered_component).to have_css(link_selector, text: 'iron_maiden')
expect(rendered_content).to have_css(link_selector, text: 'iron_maiden')

expect(rendered_component).not_to have_css("#{link_selector} span.badge")
expect(rendered_content).not_to have_css("#{link_selector} span.badge")
end
end
end
Expand Up @@ -10,7 +10,7 @@
end

it 'renders the link with an undo icon' do
expect(rendered_component).to have_selector("a#update_notification_#{notification.id}[title='Mark as \"Unread\"'] > i.fa-undo")
expect(rendered_content).to have_selector("a#update_notification_#{notification.id}[title='Mark as \"Unread\"'] > i.fa-undo")
end
end

Expand All @@ -23,7 +23,7 @@
end

it 'renders the link with a check mark icon' do
expect(rendered_component).to have_selector("a#update_notification_#{notification.id}[title='Mark as \"Read\"'] > i.fa-check")
expect(rendered_content).to have_selector("a#update_notification_#{notification.id}[title='Mark as \"Read\"'] > i.fa-check")
end
end
end
Expand Up @@ -13,7 +13,7 @@
end

it 'renders a link to the BsRequest with a generic text and its number' do
expect(rendered_component).to have_link('Multiple Actions Request #456345', href: "/request/show/456345?notification_id=#{notification.id}")
expect(rendered_content).to have_link('Multiple Actions Request #456345', href: "/request/show/456345?notification_id=#{notification.id}")
end
end

Expand All @@ -26,7 +26,7 @@
end

it 'renders a link to the BsRequest with the text containing its action and number' do
expect(rendered_component).to have_link('Submit Request #123456', href: "/request/show/123456?notification_id=#{notification.id}")
expect(rendered_content).to have_link('Submit Request #123456', href: "/request/show/123456?notification_id=#{notification.id}")
end
end

Expand All @@ -39,7 +39,7 @@
end

it 'renders a link to the BsRequest with the text containing its action and number' do
expect(rendered_component).to have_link('Add Role Request #123789', href: "/request/show/123789?notification_id=#{notification.id}")
expect(rendered_content).to have_link('Add Role Request #123789', href: "/request/show/123789?notification_id=#{notification.id}")
end
end

Expand All @@ -52,7 +52,7 @@
end

it 'renders a link to the BsRequest with the text containing its action and number' do
expect(rendered_component).to have_link('Delete Request #123670', href: "/request/show/123670?notification_id=#{notification.id}")
expect(rendered_content).to have_link('Delete Request #123670', href: "/request/show/123670?notification_id=#{notification.id}")
end
end

Expand All @@ -66,7 +66,7 @@
end

it "renders a link to the comment's BsRequest with the text containing its action and number" do
expect(rendered_component).to have_link('Comment on Delete Request #123671', href: "/request/show/123671?notification_id=#{notification.id}#comments-list")
expect(rendered_content).to have_link('Comment on Delete Request #123671', href: "/request/show/123671?notification_id=#{notification.id}#comments-list")
end
end

Expand All @@ -80,7 +80,7 @@
end

it "renders a link to the comment's project" do
expect(rendered_component).to have_link('Comment on Project', href: "/project/show/projet_de_societe?notification_id=#{notification.id}#comments-list")
expect(rendered_content).to have_link('Comment on Project', href: "/project/show/projet_de_societe?notification_id=#{notification.id}#comments-list")
end
end

Expand All @@ -95,7 +95,7 @@
end

it "renders a link to the comment's package" do
expect(rendered_component).to have_link('Comment on Package', href: "/package/show/projet_de_societe/oui?notification_id=#{notification.id}#comments-list")
expect(rendered_content).to have_link('Comment on Package', href: "/package/show/projet_de_societe/oui?notification_id=#{notification.id}#comments-list")
end
end
end
14 changes: 7 additions & 7 deletions src/api/spec/components/sourcediff_tab_component_spec.rb
Expand Up @@ -23,31 +23,31 @@
end

it do
expect(rendered_component).to have_text('Submit package')
expect(rendered_content).to have_text('Submit package')
end

it do
expect(rendered_component).to have_text('to package')
expect(rendered_content).to have_text('to package')
end

it do
expect(rendered_component).to have_link(source_project.name, href: "/project/show/#{source_project.name}")
expect(rendered_content).to have_link(source_project.name, href: "/project/show/#{source_project.name}")
end

it do
expect(rendered_component).to have_link(source_package.name, href: "/package/show/#{source_project.name}/#{source_package.name}")
expect(rendered_content).to have_link(source_package.name, href: "/package/show/#{source_project.name}/#{source_package.name}")
end

it do
expect(rendered_component).to have_link(target_project.name, href: "/project/show/#{target_project.name}")
expect(rendered_content).to have_link(target_project.name, href: "/project/show/#{target_project.name}")
end

it do
expect(rendered_component).to have_link(target_package.name, href: "/package/show/#{target_project.name}/#{target_package.name}")
expect(rendered_content).to have_link(target_package.name, href: "/package/show/#{target_project.name}/#{target_package.name}")
end

it do
expect(rendered_component).to have_text('No newline at end of file')
expect(rendered_content).to have_text('No newline at end of file')
end
end
end
8 changes: 4 additions & 4 deletions src/api/spec/components/sponsors_component_spec.rb
Expand Up @@ -17,11 +17,11 @@
end

it do
expect(rendered_component).to have_text('Open Build Service is sponsored by')
expect(rendered_content).to have_text('Open Build Service is sponsored by')
end

it do
expect(rendered_component).to have_css('.sponsor-item')
expect(rendered_content).to have_css('.sponsor-item')
end
end

Expand All @@ -33,11 +33,11 @@
end

it do
expect(rendered_component).not_to have_text('Open Build Service is sponsored by')
expect(rendered_content).not_to have_text('Open Build Service is sponsored by')
end

it do
expect(rendered_component).not_to have_css('.sponsor-item')
expect(rendered_content).not_to have_css('.sponsor-item')
end
end
end

0 comments on commit f127c61

Please sign in to comment.