...@@ -95,6 +95,7 @@ export default { ...@@ -95,6 +95,7 @@ export default {
<div ref="note-body" :class="{ 'js-task-list-container': canEdit }" class="note-body"> <div ref="note-body" :class="{ 'js-task-list-container': canEdit }" class="note-body">
<suggestions <suggestions
v-if="hasSuggestion && !isEditing" v-if="hasSuggestion && !isEditing"
class="note-text md"
:suggestions="note.suggestions" :suggestions="note.suggestions"
:note-html="note.note_html" :note-html="note.note_html"
:line-type="lineType" :line-type="lineType"
... ...
......
...@@ -73,14 +73,14 @@ export default { ...@@ -73,14 +73,14 @@ export default {
<gl-button <gl-button
:aria-label="ariaLabel" :aria-label="ariaLabel"
variant="blank" variant="blank"
class="commit-edit-toggle mr-2" class="commit-edit-toggle square s24 mr-2"
@click.stop="toggle()" @click.stop="toggle()"
> >
<icon :name="collapseIcon" :size="16" /> <icon :name="collapseIcon" :size="16" />
</gl-button> </gl-button>
<span v-if="expanded">{{ __('Collapse') }}</span> <span v-if="expanded">{{ __('Collapse') }}</span>
<span v-else> <span v-else>
<span v-html="message"></span> <span class="vertical-align-middle" v-html="message"></span>
<gl-button variant="link" class="modify-message-button"> <gl-button variant="link" class="modify-message-button">
{{ modifyLinkMessage }} {{ modifyLinkMessage }}
</gl-button> </gl-button>
... ...
......
...@@ -130,6 +130,6 @@ export default { ...@@ -130,6 +130,6 @@ export default {
<template> <template>
<div> <div>
<div class="flash-container js-suggestions-flash"></div> <div class="flash-container js-suggestions-flash"></div>
<div v-show="isRendered" ref="container" class="note-text md" v-html="noteHtml"></div> <div v-show="isRendered" ref="container" v-html="noteHtml"></div>
</div> </div>
</template> </template>
...@@ -36,10 +36,6 @@ ...@@ -36,10 +36,6 @@
width: fit-content; width: fit-content;
} }
tbody {
background-color: $white-light;
}
tr { tr {
th { th {
border-bottom: solid 2px $gl-gray-100; border-bottom: solid 2px $gl-gray-100;
... ...
......
...@@ -738,6 +738,8 @@ ...@@ -738,6 +738,8 @@
z-index: 103; z-index: 103;
background: $gray-light; background: $gray-light;
color: $gl-text-color; color: $gl-text-color;
margin-top: -1px;
border-top: 1px solid $border-color;
.mr-version-menus-container { .mr-version-menus-container {
display: flex; display: flex;
...@@ -789,7 +791,6 @@ ...@@ -789,7 +791,6 @@
position: sticky; position: sticky;
top: $header-height + $mr-tabs-height; top: $header-height + $mr-tabs-height;
width: 100%; width: 100%;
border-top: 1px solid $border-color;
&.is-fileTreeOpen { &.is-fileTreeOpen {
margin-left: -16px; margin-left: -16px;
...@@ -810,10 +811,7 @@ ...@@ -810,10 +811,7 @@
top: $header-height; top: $header-height;
z-index: 200; z-index: 200;
background-color: $white-light; background-color: $white-light;
@include media-breakpoint-down(md) {
border-bottom: 1px solid $border-color; border-bottom: 1px solid $border-color;
}
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
position: sticky; position: sticky;
...@@ -1019,3 +1017,8 @@ ...@@ -1019,3 +1017,8 @@
z-index: 99999; z-index: 99999;
background: $black-transparent; background: $black-transparent;
} }
.source-branch-removal-status {
padding-left: 50px;
padding-bottom: $gl-padding;
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module SendFileUpload module SendFileUpload
def send_upload(file_upload, send_params: {}, redirect_params: {}, attachment: nil, proxy: false, disposition: 'attachment') def send_upload(file_upload, send_params: {}, redirect_params: {}, attachment: nil, proxy: false, disposition: 'attachment')
if attachment if attachment
response_disposition = ::Gitlab::ContentDisposition.format(disposition: 'attachment', filename: attachment) response_disposition = ::Gitlab::ContentDisposition.format(disposition: disposition, filename: attachment)
# Response-Content-Type will not override an existing Content-Type in # Response-Content-Type will not override an existing Content-Type in
# Google Cloud Storage, so the metadata needs to be cleared on GCS for # Google Cloud Storage, so the metadata needs to be cleared on GCS for
... ...
......
---
title: Return bottom border on MR Tabs
merge_request: !25198
author:
type: fixed
---
title: Fix suggested changes syntax highlighting
merge_request: 25116
author:
type: fixed
...@@ -29,22 +29,31 @@ module Banzai ...@@ -29,22 +29,31 @@ module Banzai
# Sanitization stripped off the section wrapper - add it back in # Sanitization stripped off the section wrapper - add it back in
first_footnote.parent.wrap('<section class="footnotes">') first_footnote.parent.wrap('<section class="footnotes">')
rand_suffix = "-#{random_number}" rand_suffix = "-#{random_number}"
modified_footnotes = {}
doc.css('sup > a[id]').each do |link_node| doc.css('sup > a[id]').each do |link_node|
ref_num = link_node[:id].delete_prefix(FOOTNOTE_LINK_ID_PREFIX) ref_num = link_node[:id].delete_prefix(FOOTNOTE_LINK_ID_PREFIX)
footnote_node = doc.at_css("li[id=#{fn_id(ref_num)}]") footnote_node = doc.at_css("li[id=#{fn_id(ref_num)}]")
backref_node = footnote_node.at_css("a[href=\"##{fnref_id(ref_num)}\"]")
if ref_num =~ INTEGER_PATTERN && footnote_node && backref_node if INTEGER_PATTERN.match?(ref_num) && (footnote_node || modified_footnotes[ref_num])
link_node[:href] += rand_suffix link_node[:href] += rand_suffix
link_node[:id] += rand_suffix link_node[:id] += rand_suffix
footnote_node[:id] += rand_suffix
backref_node[:href] += rand_suffix
# Sanitization stripped off class - add it back in # Sanitization stripped off class - add it back in
link_node.parent.append_class('footnote-ref') link_node.parent.append_class('footnote-ref')
unless modified_footnotes[ref_num]
footnote_node[:id] += rand_suffix
backref_node = footnote_node.at_css("a[href=\"##{fnref_id(ref_num)}\"]")
if backref_node
backref_node[:href] += rand_suffix
backref_node.append_class('footnote-backref') backref_node.append_class('footnote-backref')
end end
modified_footnotes[ref_num] = true
end
end
end end
doc doc
... ...
......
...@@ -17,26 +17,16 @@ RSpec.configure do |config| ...@@ -17,26 +17,16 @@ RSpec.configure do |config|
end end
end end
config.before do |example| config.before(:context) do
QA::Runtime::Logger.debug("Starting test: #{example.full_description}") if QA::Runtime::Env.debug? if self.class.metadata.keys.include?(:quarantine)
skip_or_run_quarantined_tests(self.class.metadata.keys, config.inclusion_filter.rules.keys)
# If quarantine is tagged, skip tests that have other metadata unless
# they're also tagged. This lets us run quarantined tests in a particular
# category without running tests in other categories.
# E.g., if a test is tagged 'smoke' and 'quarantine', and another is tagged
# 'ldap' and 'quarantine', if we wanted to run just quarantined smoke tests
# using `--tag quarantine --tag smoke`, without this check we'd end up
# running that ldap test as well.
if config.inclusion_filter[:quarantine]
skip("Running tests tagged with all of #{config.inclusion_filter.rules.keys}") unless quarantine_and_optional_other_tag?(example, config)
end end
end end
config.before(:each, :quarantine) do |example| config.before do |example|
# Skip tests in quarantine unless we explicitly focus on them QA::Runtime::Logger.debug("Starting test: #{example.full_description}") if QA::Runtime::Env.debug?
# We could use an exclusion filter, but this way the test report will list
# the quarantined tests when they're not run so that we're aware of them skip_or_run_quarantined_tests(example.metadata.keys, config.inclusion_filter.rules.keys)
skip('In quarantine') unless config.inclusion_filter[:quarantine]
end end
config.expect_with :rspec do |expectations| config.expect_with :rspec do |expectations|
...@@ -55,18 +45,41 @@ RSpec.configure do |config| ...@@ -55,18 +45,41 @@ RSpec.configure do |config|
Kernel.srand config.seed Kernel.srand config.seed
end end
# Skip tests in quarantine unless we explicitly focus on them.
# Skip the entire context if a context is tagged. This avoids running before
# blocks unnecessarily.
# If quarantine is focussed, skip tests/contexts that have other metadata
# unless they're also focussed. This lets us run quarantined tests in a
# particular category without running tests in other categories.
# E.g., if a test is tagged 'smoke' and 'quarantine', and another is tagged
# 'ldap' and 'quarantine', if we wanted to run just quarantined smoke tests
# using `--tag quarantine --tag smoke`, without this check we'd end up
# running that ldap test as well.
# We could use an exclusion filter, but this way the test report will list
# the quarantined tests when they're not run so that we're aware of them
def skip_or_run_quarantined_tests(metadata_keys, filter_keys)
included_filters = filters_other_than_quarantine(filter_keys)
if filter_keys.include?(:quarantine)
skip("Only running tests tagged with :quarantine and any of #{included_filters}") unless quarantine_and_optional_other_tag?(metadata_keys, included_filters)
else
skip('In quarantine') if metadata_keys.include?(:quarantine)
end
end
def filters_other_than_quarantine(filter_keys)
filter_keys.reject { |key| key == :quarantine }
end
# Checks if a test has the 'quarantine' tag and other tags in the inclusion filter. # Checks if a test has the 'quarantine' tag and other tags in the inclusion filter.
# #
# Returns true if # Returns true if
# - the example metadata includes the quarantine tag # - the metadata includes the quarantine tag
# - and the metadata and inclusion filter both have any other tag # - and the metadata and inclusion filter both have any other tag
# - or no other tags are in the inclusion filter # - or no other tags are in the inclusion filter
def quarantine_and_optional_other_tag?(example, config) def quarantine_and_optional_other_tag?(metadata_keys, included_filters)
return false unless example.metadata.keys.include? :quarantine return false unless metadata_keys.include? :quarantine
return true if included_filters.empty?
filters_other_than_quarantine = config.inclusion_filter.rules.keys.reject { |key| key == :quarantine }
return true if filters_other_than_quarantine.empty?
filters_other_than_quarantine.any? { |key| example.metadata.keys.include? key } included_filters.any? { |key| metadata_keys.include? key }
end end
...@@ -10,49 +10,82 @@ describe 'rspec config tests' do ...@@ -10,49 +10,82 @@ describe 'rspec config tests' do
end end
end end
context 'default' do
it_behaves_like 'passing tests'
end
context 'foo', :foo do context 'foo', :foo do
it_behaves_like 'passing tests' it_behaves_like 'passing tests'
end end
context 'default' do context 'quarantine', :quarantine do
it_behaves_like 'passing tests'
end
context 'bar quarantine', :bar, :quarantine do
it_behaves_like 'passing tests' it_behaves_like 'passing tests'
end end
end end
end end
context 'default config' do context 'with no tags focussed' do
it 'tests are skipped if in quarantine' do before do
group.run group.run
end
foo_context = group.children.find { |c| c.description == "foo" } context 'in a context tagged :foo' do
foo_examples = foo_context.descendant_filtered_examples it 'skips tests in quarantine' do
expect(foo_examples.count).to eq(2) context = group.children.find { |c| c.description == "foo" }
examples = context.descendant_filtered_examples
expect(examples.count).to eq(2)
ex = foo_examples.find { |e| e.description == "not in quarantine" } ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:passed) expect(ex.execution_result.status).to eq(:passed)
ex = foo_examples.find { |e| e.description == "in quarantine" } ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending) expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('In quarantine') expect(ex.execution_result.pending_message).to eq('In quarantine')
end
end
default_context = group.children.find { |c| c.description == "default" } context 'in an untagged context' do
default_examples = default_context.descendant_filtered_examples it 'skips tests in quarantine' do
expect(default_examples.count).to eq(2) context = group.children.find { |c| c.description == "default" }
examples = context.descendant_filtered_examples
expect(examples.count).to eq(2)
ex = default_examples.find { |e| e.description == "not in quarantine" } ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:passed) expect(ex.execution_result.status).to eq(:passed)
ex = default_examples.find { |e| e.description == "in quarantine" } ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending) expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('In quarantine') expect(ex.execution_result.pending_message).to eq('In quarantine')
end end
end end
context "with 'quarantine' tagged" do context 'in a context tagged :quarantine' do
it 'skips all tests' do
context = group.children.find { |c| c.description == "quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to eq(2)
ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('In quarantine')
end
end
end
context 'with :quarantine focussed' do
before do before do
RSpec.configure do |config| RSpec.configure do |config|
config.inclusion_filter = :quarantine config.inclusion_filter = :quarantine
end end
group.run
end end
after do after do
RSpec.configure do |config| RSpec.configure do |config|
...@@ -60,26 +93,44 @@ describe 'rspec config tests' do ...@@ -60,26 +93,44 @@ describe 'rspec config tests' do
end end
end end
it "only quarantined tests are run" do context 'in an untagged context' do
group.run it 'only runs quarantined tests' do
context = group.children.find { |c| c.description == "default" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(1)
ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:passed)
end
end
foo_context = group.children.find { |c| c.description == "foo" } context 'in a context tagged :foo' do
foo_examples = foo_context.descendant_filtered_examples it 'only runs quarantined tests' do
expect(foo_examples.count).to be(1) context = group.children.find { |c| c.description == "foo" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(1)
ex = foo_examples.find { |e| e.description == "in quarantine" } ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:passed) expect(ex.execution_result.status).to eq(:passed)
end
end
context 'in a context tagged :quarantine' do
it 'runs all tests' do
context = group.children.find { |c| c.description == "quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
default_context = group.children.find { |c| c.description == "default" } ex = examples.find { |e| e.description == "in quarantine" }
default_examples = default_context.descendant_filtered_examples expect(ex.execution_result.status).to eq(:passed)
expect(default_examples.count).to be(1)
ex = default_examples.find { |e| e.description == "in quarantine" } ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:passed) expect(ex.execution_result.status).to eq(:passed)
end end
end end
end
context "with 'foo' tagged" do context 'with a non-quarantine tag (:foo) focussed' do
before do before do
RSpec.configure do |config| RSpec.configure do |config|
config.inclusion_filter = :foo config.inclusion_filter = :foo
...@@ -93,69 +144,43 @@ describe 'rspec config tests' do ...@@ -93,69 +144,43 @@ describe 'rspec config tests' do
end end
end end
it "tests are not run if not tagged 'foo'" do context 'in an untagged context' do
default_context = group.children.find { |c| c.description == "default" } it 'runs no tests' do
expect(default_context.descendant_filtered_examples.count).to eq(0) context = group.children.find { |c| c.description == "default" }
expect(context.descendant_filtered_examples.count).to eq(0)
end
end end
it "tests are skipped if in quarantine" do context 'in a context tagged :foo' do
foo_context = group.children.find { |c| c.description == "foo" } it 'skips quarantined tests' do
foo_examples = foo_context.descendant_filtered_examples context = group.children.find { |c| c.description == "foo" }
expect(foo_examples.count).to eq(2) examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
ex = foo_examples.find { |e| e.description == "not in quarantine" } ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:passed) expect(ex.execution_result.status).to eq(:passed)
ex = foo_examples.find { |e| e.description == "in quarantine" } ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending) expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('In quarantine') expect(ex.execution_result.pending_message).to eq('In quarantine')
end end
end end
context "with 'quarantine' and 'foo' tagged" do context 'in a context tagged :quarantine' do
before do it 'runs no tests' do
RSpec.configure do |config| context = group.children.find { |c| c.description == "quarantine" }
config.inclusion_filter = { quarantine: true, foo: true } expect(context.descendant_filtered_examples.count).to eq(0)
end end
end end
after do
RSpec.configure do |config|
config.inclusion_filter.clear
end
end
it 'of tests tagged foo, only tests in quarantine run' do
group.run
foo_context = group.children.find { |c| c.description == "foo" }
foo_examples = foo_context.descendant_filtered_examples
expect(foo_examples.count).to eq(2)
ex = foo_examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('Running tests tagged with all of [:quarantine, :foo]')
ex = foo_examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:passed)
end end
it 'if tests are not tagged they are skipped, even if they are in quarantine' do context 'with :quarantine and a non-quarantine tag (:foo) focussed' do
group.run
default_context = group.children.find { |c| c.description == "default" }
default_examples = default_context.descendant_filtered_examples
expect(default_examples.count).to eq(1)
ex = default_examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('Running tests tagged with all of [:quarantine, :foo]')
end
end
context "with 'foo' and 'bar' tagged" do
before do before do
RSpec.configure do |config| RSpec.configure do |config|
config.inclusion_filter = { bar: true, foo: true } config.inclusion_filter = { quarantine: true, foo: true }
end end
group.run
end end
after do after do
RSpec.configure do |config| RSpec.configure do |config|
...@@ -163,67 +188,67 @@ describe 'rspec config tests' do ...@@ -163,67 +188,67 @@ describe 'rspec config tests' do
end end
end end
it "runs tests tagged either 'foo' or 'bar'" do context 'in an untagged context' do
group = RSpec.describe do it 'ignores untagged tests and skips tests even if in quarantine' do
example 'foo', :foo do context = group.children.find { |c| c.description == "default" }
end examples = context.descendant_filtered_examples
example 'bar', :bar do expect(examples.count).to eq(1)
end
example 'foo and bar', :foo, :bar do ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
end end
end end
group.run context 'in a context tagged :foo' do
expect(group.examples.count).to eq(3) it 'only runs quarantined tests' do
context = group.children.find { |c| c.description == "foo" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
ex = group.examples.find { |e| e.description == "foo" } ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:passed) expect(ex.execution_result.status).to eq(:passed)
ex = group.examples.find { |e| e.description == "bar" } ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:passed) expect(ex.execution_result.status).to eq(:pending)
ex = group.examples.find { |e| e.description == "foo and bar" }
expect(ex.execution_result.status).to eq(:passed)
end
it "skips quarantined tests tagged 'foo' and/or 'bar'" do
group = RSpec.describe do
example 'foo in quarantine', :foo, :quarantine do
end
example 'foo and bar in quarantine', :foo, :bar, :quarantine do
end end
end end
group.run context 'in a context tagged :quarantine' do
expect(group.examples.count).to eq(2) it 'skips all tests' do
context = group.children.find { |c| c.description == "quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
ex = group.examples.find { |e| e.description == "foo in quarantine" } ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending) expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('In quarantine')
ex = group.examples.find { |e| e.description == "foo and bar in quarantine" } ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:pending) expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('In quarantine')
end
it "ignores quarantined tests not tagged either 'foo' or 'bar'" do
group = RSpec.describe do
example 'in quarantine', :quarantine do
end end
end end
group.run context 'in a context tagged :bar and :quarantine' do
it 'skips all tests' do
context = group.children.find { |c| c.description == "quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
ex = group.examples.find { |e| e.description == "in quarantine" } ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to be_nil expect(ex.execution_result.status).to eq(:pending)
end
end end
end end
context "with 'foo' and 'bar' and 'quarantined' tagged" do context 'with :quarantine and multiple non-quarantine tags focussed' do
before do before do
RSpec.configure do |config| RSpec.configure do |config|
config.inclusion_filter = { bar: true, foo: true, quarantine: true } config.inclusion_filter = { bar: true, foo: true, quarantine: true }
end end
group.run
end end
after do after do
RSpec.configure do |config| RSpec.configure do |config|
...@@ -231,34 +256,49 @@ describe 'rspec config tests' do ...@@ -231,34 +256,49 @@ describe 'rspec config tests' do
end end
end end
it "runs tests tagged 'quarantine' and 'foo' or 'bar'" do context 'in a context tagged :foo' do
group = RSpec.describe do it 'only runs quarantined tests' do
example 'foo', :foo do context = group.children.find { |c| c.description == "foo" }
end examples = context.descendant_filtered_examples
example 'bar and quarantine', :bar, :quarantine do expect(examples.count).to be(2)
end
example 'foo and bar', :foo, :bar do ex = examples.find { |e| e.description == "in quarantine" }
end expect(ex.execution_result.status).to eq(:passed)
example 'foo, bar, and quarantine', :foo, :bar, :quarantine do
ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('Only running tests tagged with :quarantine and any of [:bar, :foo]')
end end
end end
group.run context 'in a context tagged :quarantine' do
expect(group.examples.count).to eq(4) it 'skips all tests' do
context = group.children.find { |c| c.description == "quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
ex = group.examples.find { |e| e.description == "foo" } ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:pending) expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('Running tests tagged with all of [:bar, :foo, :quarantine]') expect(ex.execution_result.pending_message).to eq('Only running tests tagged with :quarantine and any of [:bar, :foo]')
ex = group.examples.find { |e| e.description == "bar and quarantine" }
expect(ex.execution_result.status).to eq(:passed)
ex = group.examples.find { |e| e.description == "foo and bar" } ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:pending) expect(ex.execution_result.status).to eq(:pending)
expect(ex.execution_result.pending_message).to eq('Running tests tagged with all of [:bar, :foo, :quarantine]') expect(ex.execution_result.pending_message).to eq('Only running tests tagged with :quarantine and any of [:bar, :foo]')
end
end
context 'in a context tagged :bar and :quarantine' do
it 'runs all tests' do
context = group.children.find { |c| c.description == "bar quarantine" }
examples = context.descendant_filtered_examples
expect(examples.count).to be(2)
ex = group.examples.find { |e| e.description == "foo, bar, and quarantine" } ex = examples.find { |e| e.description == "in quarantine" }
expect(ex.execution_result.status).to eq(:passed) expect(ex.execution_result.status).to eq(:passed)
ex = examples.find { |e| e.description == "not in quarantine" }
expect(ex.execution_result.status).to eq(:passed)
end
end end
end end
end end
...@@ -52,6 +52,23 @@ describe SendFileUpload do ...@@ -52,6 +52,23 @@ describe SendFileUpload do
end end
end end
context 'with inline image' do
let(:filename) { 'test.png' }
let(:params) { { disposition: 'inline', attachment: filename } }
it 'sends a file with inline disposition' do
# Notice the filename= is omitted from the disposition; this is because
# Rails 5 will append this header in send_file
expected_params = {
filename: 'test.png',
disposition: "inline; filename*=UTF-8''test.png"
}
expect(controller).to receive(:send_file).with(uploader.path, expected_params)
subject
end
end
context 'with attachment' do context 'with attachment' do
let(:filename) { 'test.js' } let(:filename) { 'test.js' }
let(:params) { { attachment: filename } } let(:params) { { attachment: filename } }
... ...
......
...@@ -11,6 +11,7 @@ describe Banzai::Filter::FootnoteFilter do ...@@ -11,6 +11,7 @@ describe Banzai::Filter::FootnoteFilter do
let(:footnote) do let(:footnote) do
<<~EOF <<~EOF
<p>first<sup><a href="#fn1" id="fnref1">1</a></sup> and second<sup><a href="#fn2" id="fnref2">2</a></sup></p> <p>first<sup><a href="#fn1" id="fnref1">1</a></sup> and second<sup><a href="#fn2" id="fnref2">2</a></sup></p>
<p>same reference<sup><a href="#fn1" id="fnref1">1</a></sup></p>
<ol> <ol>
<li id="fn1"> <li id="fn1">
<p>one <a href="#fnref1">↩</a></p> <p>one <a href="#fnref1">↩</a></p>
...@@ -25,6 +26,7 @@ describe Banzai::Filter::FootnoteFilter do ...@@ -25,6 +26,7 @@ describe Banzai::Filter::FootnoteFilter do
let(:filtered_footnote) do let(:filtered_footnote) do
<<~EOF <<~EOF
<p>first<sup class="footnote-ref"><a href="#fn1-#{identifier}" id="fnref1-#{identifier}">1</a></sup> and second<sup class="footnote-ref"><a href="#fn2-#{identifier}" id="fnref2-#{identifier}">2</a></sup></p> <p>first<sup class="footnote-ref"><a href="#fn1-#{identifier}" id="fnref1-#{identifier}">1</a></sup> and second<sup class="footnote-ref"><a href="#fn2-#{identifier}" id="fnref2-#{identifier}">2</a></sup></p>
<p>same reference<sup class="footnote-ref"><a href="#fn1-#{identifier}" id="fnref1-#{identifier}">1</a></sup></p>
<section class="footnotes"><ol> <section class="footnotes"><ol>
<li id="fn1-#{identifier}"> <li id="fn1-#{identifier}">
<p>one <a href="#fnref1-#{identifier}" class="footnote-backref">↩</a></p> <p>one <a href="#fnref1-#{identifier}" class="footnote-backref">↩</a></p>
... ...
......