Skip to content

Commit

Permalink
Use the non-globally exposed RSpec syntax, cont
Browse files Browse the repository at this point in the history
  • Loading branch information
pirj committed Jul 24, 2022
1 parent e395e2a commit c2039a7
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions spec/lib/topic_view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -751,30 +751,30 @@ def topic_view_near(post, show_deleted = false)
context "uncategorized topic" do
context "topic_page_title_includes_category is false" do
before { SiteSetting.topic_page_title_includes_category = false }
it { should eq(topic.title) }
it { is_expected.to eq(topic.title) }
end

context "topic_page_title_includes_category is true" do
before { SiteSetting.topic_page_title_includes_category = true }
it { should eq(topic.title) }
it { is_expected.to eq(topic.title) }

context "tagged topic" do
before { topic.tags << [tag1, tag2] }

context "tagging enabled" do
before { SiteSetting.tagging_enabled = true }

it { should start_with(topic.title) }
it { should_not include(tag1.name) }
it { should end_with(tag2.name) } # tag2 has higher topic count
it { is_expected.to start_with(topic.title) }
it { is_expected.not_to include(tag1.name) }
it { is_expected.to end_with(tag2.name) } # tag2 has higher topic count
end

context "tagging disabled" do
before { SiteSetting.tagging_enabled = false }

it { should start_with(topic.title) }
it { should_not include(tag1.name) }
it { should_not include(tag2.name) }
it { is_expected.to start_with(topic.title) }
it { is_expected.not_to include(tag1.name) }
it { is_expected.not_to include(tag2.name) }
end
end
end
Expand All @@ -787,24 +787,24 @@ def topic_view_near(post, show_deleted = false)

context "topic_page_title_includes_category is false" do
before { SiteSetting.topic_page_title_includes_category = false }
it { should eq(topic.title) }
it { is_expected.to eq(topic.title) }
end

context "topic_page_title_includes_category is true" do
before { SiteSetting.topic_page_title_includes_category = true }
it { should start_with(topic.title) }
it { should end_with(category.name) }
it { is_expected.to start_with(topic.title) }
it { is_expected.to end_with(category.name) }

context "tagged topic" do
before do
SiteSetting.tagging_enabled = true
topic.tags << [tag1, tag2]
end

it { should start_with(topic.title) }
it { should end_with(category.name) }
it { should_not include(tag1.name) }
it { should_not include(tag2.name) }
it { is_expected.to start_with(topic.title) }
it { is_expected.to end_with(category.name) }
it { is_expected.not_to include(tag1.name) }
it { is_expected.not_to include(tag2.name) }
end
end
end
Expand Down

0 comments on commit c2039a7

Please sign in to comment.