Commit 1786dd4c authored by Douwe Maan's avatar Douwe Maan Committed by Toon Claes

Don't use TestLicense.destroy! as it triggers License.block_changes? which...

Don't use TestLicense.destroy! as it triggers License.block_changes? which will block funcionality unintentionally
parent 6861b471
......@@ -17,7 +17,7 @@ describe 'Issue Boards', feature: true, js: true do
before do
Timecop.freeze
TestLicense.destroy!
stub_licensed_features(multiple_issue_assignees: false)
project.team << [user, :master]
......
......@@ -13,7 +13,7 @@ describe 'New/edit issue', :feature, :js do
let!(:issue) { create(:issue, project: project, assignees: [user], milestone: milestone) }
before do
TestLicense.destroy!
stub_licensed_features(multiple_issue_assignees: false, issue_weights: false)
project.team << [user, :master]
project.team << [user2, :master]
......@@ -32,8 +32,8 @@ describe 'New/edit issue', :feature, :js do
# the original method, resulting in infinite recurison when called.
# This is likely a bug with helper modules included into dynamically generated view classes.
# To work around this, we have to hold on to and call to the original implementation manually.
original_issue_dropdown_options = FormHelper.instance_method(:issue_assignees_dropdown_options)
allow_any_instance_of(FormHelper).to receive(:issue_assignees_dropdown_options).and_wrap_original do |original, *args|
original_issue_dropdown_options = EE::FormHelper.instance_method(:issue_assignees_dropdown_options)
allow_any_instance_of(EE::FormHelper).to receive(:issue_assignees_dropdown_options).and_wrap_original do |original, *args|
options = original_issue_dropdown_options.bind(original.receiver).call(*args)
options[:data][:per_page] = 2
......@@ -144,6 +144,8 @@ describe 'New/edit issue', :feature, :js do
page.within '.dropdown-menu-labels' do
click_link label.title
click_link label2.title
find('.dropdown-menu-close').click
end
page.within '.js-label-select' do
expect(page).to have_content label.title
......@@ -151,12 +153,6 @@ describe 'New/edit issue', :feature, :js do
expect(page.all('input[name="issue[label_ids][]"]', visible: false)[1].value).to match(label.id.to_s)
expect(page.all('input[name="issue[label_ids][]"]', visible: false)[2].value).to match(label2.id.to_s)
click_button 'Weight'
page.within '.dropdown-menu-weight' do
click_link '1'
end
click_button 'Submit issue'
page.within '.issuable-sidebar' do
......
......@@ -61,8 +61,10 @@ describe API::Issues do
before(:all) do
project.team << [user, :reporter]
project.team << [guest, :guest]
end
TestLicense.destroy!
before do
stub_licensed_features(multiple_issue_assignees: false, issue_weights: false)
end
describe "GET /issues" do
......
......@@ -12,7 +12,7 @@ describe API::Milestones do
before do
project.team << [user, :developer]
TestLicense.destroy!
stub_licensed_features(issue_weights: false)
end
describe 'GET /projects/:id/milestones' do
......
......@@ -4,8 +4,4 @@ class TestLicense
FactoryGirl.create(:license)
end
def self.destroy!
License.destroy_all
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