Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Commit

Permalink
Last incompatible index with redmine_crm
Browse files Browse the repository at this point in the history
  • Loading branch information
Codruț Constantin Gușoi committed Feb 18, 2016
1 parent 8a9273f commit 714ba7c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
6 changes: 4 additions & 2 deletions db/migrate/20151209153801_acts_as_taggable_migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ def up

# AddMissingUniqueIndices
unless column_exists?(:tags, :taggings_count)
# redmine_crm skips the following indexes so we have to check their exitance
unless index_exists?(:tags, :name)
add_index :tags, :name, unique: true
end

remove_index :taggings, :tag_id
if index_exists?(:taggings, :tag_id)
remove_index :taggings, :tag_id
end

# redmine_crm skips this index
if index_exists?(:taggings, [:taggable_id, :taggable_type, :context])
remove_index :taggings, [:taggable_id, :taggable_type, :context]
end
Expand Down
4 changes: 2 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
issues_sort_by: 'name',
issues_sort_order: 'asc'
},
partial: 'tags/settings'
partial: 'tags/settings'
end

Rails.application.config.after_initialize do
test_dependencies = { redmine_testing_gems: '1.3.1' }
test_dependencies = {redmine_testing_gems: '1.3.1'}
current_plugin = Redmine::Plugin.find(:redmine_tags)
check_dependencies = proc do |plugin, version|
begin
Expand Down
14 changes: 14 additions & 0 deletions spec/support/login_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,18 @@ def login_as(user)
@request.session[:user_id] = user.id
allow(User).to receive(:current).and_return(user)
end

def ui_login_user(login, password)
visit '/my/page'

expect(current_path).to eq('/login')

within('#login-form form') do
fill_in('username', with: login)
fill_in('password', with: password)
find('input[name=login]').click
end

expect(current_path).to eq('/my/page')
end
end

0 comments on commit 714ba7c

Please sign in to comment.