2015-10-11 17:41:23 +08:00
|
|
|
require 'rails_helper'
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
describe ListController do
|
|
|
|
|
2013-02-26 00:42:20 +08:00
|
|
|
# we need some data
|
|
|
|
before do
|
2013-02-06 03:16:51 +08:00
|
|
|
@user = Fabricate(:coding_horror)
|
2013-03-23 23:02:59 +08:00
|
|
|
@post = Fabricate(:post, user: @user)
|
2013-06-22 04:31:40 +08:00
|
|
|
|
|
|
|
# forces tests down some code paths
|
2017-07-07 14:09:14 +08:00
|
|
|
SiteSetting.top_menu = 'latest,-video|new|unread|categories|category/beer'
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
|
2013-03-28 21:01:13 +08:00
|
|
|
describe 'indexes' do
|
|
|
|
|
2014-09-12 03:30:10 +08:00
|
|
|
(Discourse.anonymous_filters - [:categories]).each do |filter|
|
2013-06-22 04:31:40 +08:00
|
|
|
context "#{filter}" do
|
2017-08-31 12:06:56 +08:00
|
|
|
before { get filter }
|
2015-01-10 01:04:02 +08:00
|
|
|
it { is_expected.to respond_with(:success) }
|
2013-03-28 21:01:13 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-05-28 15:52:52 +08:00
|
|
|
it 'allows users to filter on a set of topic ids' do
|
2013-10-24 07:05:51 +08:00
|
|
|
p = create_post
|
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
get :latest, format: :json, params: { topic_ids: "#{p.topic_id}" }
|
2015-01-10 01:04:02 +08:00
|
|
|
expect(response).to be_success
|
2013-05-28 15:52:52 +08:00
|
|
|
parsed = JSON.parse(response.body)
|
2015-01-10 01:04:02 +08:00
|
|
|
expect(parsed["topic_list"]["topics"].length).to eq(1)
|
2013-05-28 15:52:52 +08:00
|
|
|
end
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
|
2013-10-12 00:35:12 +08:00
|
|
|
describe 'RSS feeds' do
|
2017-03-13 16:54:10 +08:00
|
|
|
it 'renders latest RSS' do
|
2015-09-03 02:25:18 +08:00
|
|
|
get "latest_feed", format: :rss
|
|
|
|
expect(response).to be_success
|
|
|
|
expect(response.content_type).to eq('application/rss+xml')
|
2013-10-12 00:35:12 +08:00
|
|
|
end
|
|
|
|
|
2017-03-13 16:54:10 +08:00
|
|
|
it 'renders top RSS' do
|
|
|
|
get "top_feed", format: :rss
|
|
|
|
expect(response).to be_success
|
|
|
|
expect(response.content_type).to eq('application/rss+xml')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders all time top RSS' do
|
|
|
|
get "top_all_feed", format: :rss
|
|
|
|
expect(response).to be_success
|
|
|
|
expect(response.content_type).to eq('application/rss+xml')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders yearly top RSS' do
|
|
|
|
get "top_yearly_feed", format: :rss
|
|
|
|
expect(response).to be_success
|
|
|
|
expect(response.content_type).to eq('application/rss+xml')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders quarterly top RSS' do
|
|
|
|
get "top_quarterly_feed", format: :rss
|
|
|
|
expect(response).to be_success
|
|
|
|
expect(response.content_type).to eq('application/rss+xml')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders monthly top RSS' do
|
|
|
|
get "top_monthly_feed", format: :rss
|
|
|
|
expect(response).to be_success
|
|
|
|
expect(response.content_type).to eq('application/rss+xml')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders weekly top RSS' do
|
|
|
|
get "top_weekly_feed", format: :rss
|
|
|
|
expect(response).to be_success
|
|
|
|
expect(response.content_type).to eq('application/rss+xml')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders daily top RSS' do
|
|
|
|
get "top_daily_feed", format: :rss
|
|
|
|
expect(response).to be_success
|
|
|
|
expect(response.content_type).to eq('application/rss+xml')
|
|
|
|
end
|
2013-10-12 00:35:12 +08:00
|
|
|
end
|
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
context 'category' do
|
|
|
|
|
|
|
|
context 'in a category' do
|
|
|
|
let(:category) { Fabricate(:category) }
|
|
|
|
|
2014-02-06 04:33:52 +08:00
|
|
|
context 'without access to see the category' do
|
|
|
|
before do
|
|
|
|
Guardian.any_instance.expects(:can_see?).with(category).returns(false)
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_latest, params: { category: category.slug }
|
2014-02-06 04:33:52 +08:00
|
|
|
end
|
|
|
|
|
2015-01-10 01:04:02 +08:00
|
|
|
it { is_expected.not_to respond_with(:success) }
|
2014-02-06 04:33:52 +08:00
|
|
|
end
|
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
context 'with access to see the category' do
|
|
|
|
before do
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_latest, params: { category: category.slug }
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
|
2015-01-10 01:04:02 +08:00
|
|
|
it { is_expected.to respond_with(:success) }
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
2013-02-15 05:51:48 +08:00
|
|
|
|
|
|
|
context 'with a link that includes an id' do
|
|
|
|
before do
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_latest, params: {
|
|
|
|
category: "#{category.id}-#{category.slug}"
|
|
|
|
}
|
2013-02-15 05:51:48 +08:00
|
|
|
end
|
|
|
|
|
2015-01-10 01:04:02 +08:00
|
|
|
it { is_expected.to respond_with(:success) }
|
2013-02-15 05:51:48 +08:00
|
|
|
end
|
|
|
|
|
2015-12-28 14:28:16 +08:00
|
|
|
context 'with a link that has a parent slug, slug and id in its path' do
|
|
|
|
let(:child_category) { Fabricate(:category, parent_category: category) }
|
|
|
|
|
|
|
|
context "with valid slug" do
|
|
|
|
before do
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_latest, params: {
|
|
|
|
parent_category: category.slug,
|
|
|
|
category: child_category.slug,
|
|
|
|
id: child_category.id
|
|
|
|
}
|
2015-12-28 14:28:16 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it { is_expected.to redirect_to(child_category.url) }
|
|
|
|
end
|
|
|
|
|
|
|
|
context "with invalid slug" do
|
|
|
|
before do
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_latest, params: {
|
|
|
|
parent_category: 'random slug',
|
|
|
|
category: 'random slug',
|
|
|
|
id: child_category.id
|
|
|
|
}
|
2015-12-28 14:28:16 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it { is_expected.to redirect_to(child_category.url) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-08-23 03:46:17 +08:00
|
|
|
context 'another category exists with a number at the beginning of its name' do
|
|
|
|
# One category has another category's id at the beginning of its name
|
|
|
|
let!(:other_category) { Fabricate(:category, name: "#{category.id} name") }
|
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
it 'uses the correct category' do
|
|
|
|
get :category_latest,
|
|
|
|
params: { category: other_category.slug },
|
|
|
|
format: :json
|
2013-08-23 03:46:17 +08:00
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
expect(response).to be_success
|
2013-08-23 03:46:17 +08:00
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
body = JSON.parse(response.body)
|
|
|
|
|
|
|
|
expect(body["topic_list"]["topics"].first["category_id"])
|
|
|
|
.to eq(other_category.id)
|
2013-08-23 03:46:17 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-10-24 02:40:39 +08:00
|
|
|
context 'a child category' do
|
|
|
|
let(:sub_category) { Fabricate(:category, parent_category_id: category.id) }
|
|
|
|
|
|
|
|
context 'when parent and child are requested' do
|
|
|
|
before do
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_latest, params: {
|
|
|
|
parent_category: category.slug, category: sub_category.slug
|
|
|
|
}
|
2013-10-24 02:40:39 +08:00
|
|
|
end
|
|
|
|
|
2015-01-10 01:04:02 +08:00
|
|
|
it { is_expected.to respond_with(:success) }
|
2013-10-24 02:40:39 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'when child is requested with the wrong parent' do
|
|
|
|
before do
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_latest, params: {
|
|
|
|
parent_category: 'not_the_right_slug', category: sub_category.slug
|
|
|
|
}
|
2013-10-24 02:40:39 +08:00
|
|
|
end
|
|
|
|
|
2015-01-10 01:04:02 +08:00
|
|
|
it { is_expected.not_to respond_with(:success) }
|
2013-10-24 02:40:39 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-02-28 11:36:12 +08:00
|
|
|
describe 'feed' do
|
|
|
|
it 'renders RSS' do
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_feed, params: { category: category.slug }, format: :rss
|
2015-01-10 01:04:02 +08:00
|
|
|
expect(response).to be_success
|
|
|
|
expect(response.content_type).to eq('application/rss+xml')
|
2013-02-28 11:36:12 +08:00
|
|
|
end
|
|
|
|
end
|
2017-03-02 23:56:04 +08:00
|
|
|
|
|
|
|
describe "category default views" do
|
2017-05-09 03:17:58 +08:00
|
|
|
it "has a top default view" do
|
2017-03-23 04:54:12 +08:00
|
|
|
category.update_attributes!(default_view: 'top', default_top_period: 'monthly')
|
|
|
|
described_class.expects(:best_period_with_topics_for).with(anything, category.id, :monthly).returns(:monthly)
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_default, params: { category: category.slug }
|
2017-03-02 23:56:04 +08:00
|
|
|
expect(response).to be_success
|
|
|
|
end
|
|
|
|
|
2017-05-09 03:17:58 +08:00
|
|
|
it "has a default view of nil" do
|
2017-03-02 23:56:04 +08:00
|
|
|
category.update_attributes!(default_view: nil)
|
|
|
|
described_class.expects(:best_period_for).never
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_default, params: { category: category.slug }
|
2017-03-02 23:56:04 +08:00
|
|
|
expect(response).to be_success
|
|
|
|
end
|
|
|
|
|
2017-05-09 03:17:58 +08:00
|
|
|
it "has a default view of ''" do
|
|
|
|
category.update_attributes!(default_view: '')
|
|
|
|
described_class.expects(:best_period_for).never
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_default, params: { category: category.slug }
|
2017-05-09 03:17:58 +08:00
|
|
|
expect(response).to be_success
|
|
|
|
end
|
|
|
|
|
|
|
|
it "has a default view of latest" do
|
2017-03-02 23:56:04 +08:00
|
|
|
category.update_attributes!(default_view: 'latest')
|
|
|
|
described_class.expects(:best_period_for).never
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_default, params: { category: category.slug }
|
2017-03-02 23:56:04 +08:00
|
|
|
expect(response).to be_success
|
|
|
|
end
|
2017-07-03 15:55:22 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "renders canonical tag" do
|
|
|
|
render_views
|
2017-05-09 03:17:58 +08:00
|
|
|
|
2017-07-03 15:55:22 +08:00
|
|
|
it 'for category default view' do
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_default, params: { category: category.slug }
|
2017-07-03 15:55:22 +08:00
|
|
|
expect(response).to be_success
|
|
|
|
expect(css_select("link[rel=canonical]").length).to eq(1)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'for category latest view' do
|
2017-08-31 12:06:56 +08:00
|
|
|
get :category_latest, params: { category: category.slug }
|
2017-07-03 15:55:22 +08:00
|
|
|
expect(response).to be_success
|
|
|
|
expect(css_select("link[rel=canonical]").length).to eq(1)
|
|
|
|
end
|
2017-03-02 23:56:04 +08:00
|
|
|
end
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-10-19 21:21:17 +08:00
|
|
|
describe "topics_by" do
|
|
|
|
let!(:user) { log_in }
|
|
|
|
|
|
|
|
it "should respond with a list" do
|
2017-08-31 12:06:56 +08:00
|
|
|
get :topics_by, params: { username: @user.username }
|
2015-01-10 01:04:02 +08:00
|
|
|
expect(response).to be_success
|
2013-10-19 21:21:17 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-10-01 02:35:11 +08:00
|
|
|
context "private_messages" do
|
|
|
|
let!(:user) { log_in }
|
|
|
|
|
|
|
|
it "raises an error when can_see_private_messages? is false " do
|
|
|
|
Guardian.any_instance.expects(:can_see_private_messages?).returns(false)
|
2017-08-31 12:06:56 +08:00
|
|
|
get :private_messages, params: { username: @user.username }
|
2015-01-10 01:04:02 +08:00
|
|
|
expect(response).to be_forbidden
|
2013-10-01 02:35:11 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it "succeeds when can_see_private_messages? is false " do
|
|
|
|
Guardian.any_instance.expects(:can_see_private_messages?).returns(true)
|
2017-08-31 12:06:56 +08:00
|
|
|
get :private_messages, params: { username: @user.username }
|
2015-01-10 01:04:02 +08:00
|
|
|
expect(response).to be_success
|
2013-10-01 02:35:11 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "private_messages_sent" do
|
|
|
|
let!(:user) { log_in }
|
|
|
|
|
|
|
|
it "raises an error when can_see_private_messages? is false " do
|
|
|
|
Guardian.any_instance.expects(:can_see_private_messages?).returns(false)
|
2017-08-31 12:06:56 +08:00
|
|
|
get :private_messages_sent, params: { username: @user.username }
|
2015-01-10 01:04:02 +08:00
|
|
|
expect(response).to be_forbidden
|
2013-10-01 02:35:11 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it "succeeds when can_see_private_messages? is false " do
|
|
|
|
Guardian.any_instance.expects(:can_see_private_messages?).returns(true)
|
2017-08-31 12:06:56 +08:00
|
|
|
get :private_messages_sent, params: { username: @user.username }
|
2015-01-10 01:04:02 +08:00
|
|
|
expect(response).to be_success
|
2013-10-01 02:35:11 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "private_messages_unread" do
|
|
|
|
let!(:user) { log_in }
|
|
|
|
|
|
|
|
it "raises an error when can_see_private_messages? is false " do
|
|
|
|
Guardian.any_instance.expects(:can_see_private_messages?).returns(false)
|
2017-08-31 12:06:56 +08:00
|
|
|
get :private_messages_unread, params: { username: @user.username }
|
2015-01-10 01:04:02 +08:00
|
|
|
expect(response).to be_forbidden
|
2013-10-01 02:35:11 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it "succeeds when can_see_private_messages? is false " do
|
|
|
|
Guardian.any_instance.expects(:can_see_private_messages?).returns(true)
|
2017-08-31 12:06:56 +08:00
|
|
|
get :private_messages_unread, params: { username: @user.username }
|
2015-01-10 01:04:02 +08:00
|
|
|
expect(response).to be_success
|
2013-10-01 02:35:11 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
context 'read' do
|
|
|
|
it 'raises an error when not logged in' do
|
2017-08-31 12:06:56 +08:00
|
|
|
expect { get :read }.to raise_error(Discourse::NotLoggedIn)
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'when logged in' do
|
|
|
|
before do
|
|
|
|
log_in_user(@user)
|
2017-08-31 12:06:56 +08:00
|
|
|
get :read
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
|
2015-01-10 01:04:02 +08:00
|
|
|
it { is_expected.to respond_with(:success) }
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-05-08 01:04:39 +08:00
|
|
|
describe "best_periods_for" do
|
2014-03-12 19:58:41 +08:00
|
|
|
|
|
|
|
it "returns yearly for more than 180 days" do
|
2017-03-23 04:54:12 +08:00
|
|
|
expect(ListController.best_periods_for(nil, :all)).to eq([:yearly])
|
|
|
|
expect(ListController.best_periods_for(180.days.ago, :all)).to eq([:yearly])
|
2014-03-12 19:58:41 +08:00
|
|
|
end
|
|
|
|
|
2014-05-08 01:04:39 +08:00
|
|
|
it "includes monthly when less than 180 days and more than 35 days" do
|
2014-03-12 19:58:41 +08:00
|
|
|
(35...180).each do |date|
|
2017-03-23 04:54:12 +08:00
|
|
|
expect(ListController.best_periods_for(date.days.ago, :all)).to eq([:monthly, :yearly])
|
2014-03-12 19:58:41 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-05-08 01:04:39 +08:00
|
|
|
it "includes weekly when less than 35 days and more than 8 days" do
|
2014-03-12 19:58:41 +08:00
|
|
|
(8...35).each do |date|
|
2017-03-23 04:54:12 +08:00
|
|
|
expect(ListController.best_periods_for(date.days.ago, :all)).to eq([:weekly, :monthly, :yearly])
|
2014-03-12 19:58:41 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-05-08 01:04:39 +08:00
|
|
|
it "includes daily when less than 8 days" do
|
2014-03-12 19:58:41 +08:00
|
|
|
(0...8).each do |date|
|
2017-03-23 04:54:12 +08:00
|
|
|
expect(ListController.best_periods_for(date.days.ago, :all)).to eq([:daily, :weekly, :monthly, :yearly])
|
2014-03-12 19:58:41 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-04-06 01:48:45 +08:00
|
|
|
it "returns default even for more than 180 days" do
|
2017-03-23 04:54:12 +08:00
|
|
|
expect(ListController.best_periods_for(nil, :monthly)).to eq([:monthly, :yearly])
|
|
|
|
expect(ListController.best_periods_for(180.days.ago, :monthly)).to eq([:monthly, :yearly])
|
2016-04-06 01:48:45 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it "returns default even when less than 180 days and more than 35 days" do
|
|
|
|
(35...180).each do |date|
|
2017-03-23 04:54:12 +08:00
|
|
|
expect(ListController.best_periods_for(date.days.ago, :weekly)).to eq([:weekly, :monthly, :yearly])
|
2016-04-06 01:48:45 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it "returns default even when less than 35 days and more than 8 days" do
|
|
|
|
(8...35).each do |date|
|
2017-03-23 04:54:12 +08:00
|
|
|
expect(ListController.best_periods_for(date.days.ago, :daily)).to eq([:daily, :weekly, :monthly, :yearly])
|
2016-04-06 01:48:45 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it "doesn't return default when set to all" do
|
2017-03-23 04:54:12 +08:00
|
|
|
expect(ListController.best_periods_for(nil, :all)).to eq([:yearly])
|
2016-04-06 01:48:45 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it "doesn't return value twice when matches default" do
|
2017-03-23 04:54:12 +08:00
|
|
|
expect(ListController.best_periods_for(nil, :yearly)).to eq([:yearly])
|
2016-04-06 01:48:45 +08:00
|
|
|
end
|
2014-03-12 19:58:41 +08:00
|
|
|
end
|
|
|
|
|
2016-01-21 00:55:58 +08:00
|
|
|
describe "categories suppression" do
|
|
|
|
let(:category_one) { Fabricate(:category) }
|
|
|
|
let(:sub_category) { Fabricate(:category, parent_category: category_one, suppress_from_homepage: true) }
|
|
|
|
let!(:topic_in_sub_category) { Fabricate(:topic, category: sub_category) }
|
|
|
|
|
|
|
|
let(:category_two) { Fabricate(:category, suppress_from_homepage: true) }
|
|
|
|
let!(:topic_in_category_two) { Fabricate(:topic, category: category_two) }
|
|
|
|
|
|
|
|
it "suppresses categories from the homepage" do
|
|
|
|
get SiteSetting.homepage, format: :json
|
|
|
|
expect(response).to be_success
|
|
|
|
|
|
|
|
topic_titles = JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["title"] }
|
|
|
|
expect(topic_titles).not_to include(topic_in_sub_category.title, topic_in_category_two.title)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "does not suppress" do
|
2017-08-31 12:06:56 +08:00
|
|
|
get SiteSetting.homepage, params: { category: category_one.id }, format: :json
|
2016-01-21 00:55:58 +08:00
|
|
|
expect(response).to be_success
|
|
|
|
|
|
|
|
topic_titles = JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["title"] }
|
|
|
|
expect(topic_titles).to include(topic_in_sub_category.title)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2016-11-23 10:31:05 +08:00
|
|
|
describe "safe mode" do
|
|
|
|
render_views
|
|
|
|
|
|
|
|
it "handles safe mode" do
|
|
|
|
get :latest
|
|
|
|
expect(response.body).to match(/plugin\.js/)
|
|
|
|
expect(response.body).to match(/plugin-third-party\.js/)
|
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
get :latest, params: { safe_mode: "no_plugins" }
|
2016-11-23 10:31:05 +08:00
|
|
|
expect(response.body).not_to match(/plugin\.js/)
|
|
|
|
expect(response.body).not_to match(/plugin-third-party\.js/)
|
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
get :latest, params: { safe_mode: "only_official" }
|
2016-11-23 10:31:05 +08:00
|
|
|
expect(response.body).to match(/plugin\.js/)
|
|
|
|
expect(response.body).not_to match(/plugin-third-party\.js/)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|