Skip to content

Commit

Permalink
Merge branch 'release/0.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
haru committed Aug 21, 2017
2 parents 7897084 + b428e79 commit 7cf230c
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 11 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: travis-ci
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage
Gemfile
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: ruby
rvm:
- 2.2
- 2.3
env:
- REDMINE_VER=3.4-stable
script:
- export TESTSPACE=`pwd`/testspace
- export NAME_OF_PLUGIN=redmine_wiki_extensions
- export PATH_TO_PLUGIN=`pwd`
- export PATH_TO_REDMINE=$TESTSPACE/redmine
- mkdir $TESTSPACE
- bash -x ./travis.sh
notifications:
slack:
secure: DcS+4xwoLJorhegJKOARaQ+ug9wFnB98QuWew72hbY2Vi+jPZbuMv84lpdu59echFpWpTmQyAIsUDEibaWq1/u/qauBXgAidiY4UG5ELb34JwMcbEq0BuSne4BGA3m3psRMlve3RstuEzX2XnzTplQ73Go9zymAkL/rHeS5oBlyre6Ktjvh+zNtI3R5Zyn4NrnNL6Gpf8IJDN3KwQS/SIoCm9dzqNTuHJvBYSohJfKmIe6QpkjaYsUev778/GQuck9ZZNWxdjP4IctkvW+p7PxeyEZZUNjQRTNUI+Py33JZKUQgeydob9N+wg7VLeJitq8GoSqeMxmLjJJy5D8omf29KqsyVK+Ym+r5QVKQDimztNI6xQuykifZiktRUleIOjrPSZOhXDCzPIi4rapTagiWSGVATJmDpKx2b/MzjKGBjFyVrCA0GA/SmxFtZwBzaIjj0D0F6W0Vdc+25MIL6lBuAB1ZkIoMCKKOkoMPg9rfW5YXbNQ0hYpXUjduottNpU2HwJm+glbI4fvw7NKlmy1NipQNkvezv8IUmO8SwBS7EK9Sxfiv61Z2VAJEFzFVef8TdZSjyubCdy3hEUpgRWCx1wxhwJgoTgZ3ssyQVWRqvBGpZdMRtsC52yf6uMopqW8lbvpxKh7/ISivlL3cWh6SvExzQOqZeWDQNi6hLEKE=
1 change: 1 addition & 0 deletions Gemfile_for_test
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ group :test do
gem 'factory_girl_rails'
#gem 'shoulda-matchers'
gem 'shoulda'
gem 'coveralls', :require => false
end
4 changes: 2 additions & 2 deletions app/views/wiki_extensions/_tags_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% # Wiki Extensions plugin for Redmine
# Copyright (C) 2013 Haruyuki Iida
# Copyright (C) 2013-2017 Haruyuki Iida
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -63,7 +63,7 @@
</span>
<% end %>

</span> <br/>
<br/></span>
<%
}
%>
Expand Down
6 changes: 3 additions & 3 deletions assets/javascripts/wiki_extensions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
# Wiki Extensions plugin for Redmine
# Copyright (C) 2009-2014 Haruyuki Iida
# Copyright (C) 2009-2017 Haruyuki Iida
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -21,7 +21,7 @@ var auto_preview_interval = 2000;

function add_wiki_extensions_tags_form() {
var tags_form = $('#wiki_extensions_tag_form');
$('#attachments_fields').parent().after(tags_form);
$('#wiki_form div.box').append(tags_form);
}

function set_tag_atuto_complete(taglist) {
Expand All @@ -36,7 +36,7 @@ function set_tag_atuto_complete(taglist) {

function setAutPreviewCallback(url, preview_id, form_id, content_id) {
var content_org = $(content_id).val();

setInterval(function(){
var content_new = $(content_id).val();
if (content_new != content_org) {
Expand Down
4 changes: 2 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Wiki Extensions plugin for Redmine
# Copyright (C) 2009-2015 Haruyuki Iida
# Copyright (C) 2009-2017 Haruyuki Iida
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -65,7 +65,7 @@
author_url 'http://twitter.com/haru_iida'
description 'This is a Wiki Extensions plugin for Redmine'
url "http://www.r-labs.org/projects/r-labs/wiki/Wiki_Extensions_en"
version '0.8.0'
version '0.8.1'
requires_redmine :version_or_higher => '3.4.0'

project_module :wiki_extensions do
Expand Down
7 changes: 6 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
require 'simplecov'
require 'simplecov-rcov'
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
require 'coveralls'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::RcovFormatter,
Coveralls::SimpleCov::Formatter
]

SimpleCov.start do
root File.expand_path(File.dirname(__FILE__) + '/..')
Expand Down
10 changes: 7 additions & 3 deletions test/unit/wiki_extensions_tag_relation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
require File.dirname(__FILE__) + '/../test_helper'

class WikiExtensionsTagRelationTest < ActiveSupport::TestCase
fixtures :wiki_extensions_tag_relations
fixtures :wiki_extensions_tag_relations, :wiki_extensions_tags,
:projects, :users, :email_addresses, :roles, :members, :member_roles,
:enabled_modules, :wikis, :wiki_pages, :wiki_contents,
:wiki_content_versions, :attachments,
:issues, :issue_statuses, :trackers

# Replace this with your real tests.
def test_create
Expand All @@ -29,7 +33,7 @@ def test_create
tag = WikiExtensionsTag.find_or_create(1, 'bbb')
relation.tag = tag
relation.wiki_page_id = 1
assert relation.save
assert relation.save!

relation.destroy
end
Expand All @@ -40,7 +44,7 @@ def test_destroy
relation = WikiExtensionsTagRelation.new
relation.tag = tag
relation.wiki_page_id = 1
assert relation.save
assert relation.save!
relation_id = relation.id
tag_id = tag.id
assert_not_nil(WikiExtensionsTag.where(:name => tag_name).first)
Expand Down
74 changes: 74 additions & 0 deletions travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash

#/bin/bash

set -e

if [[ ! "$TESTSPACE" = /* ]] ||
[[ ! "$PATH_TO_REDMINE" = /* ]] ||
[[ ! "$REDMINE_VER" = * ]] ||
[[ ! "$NAME_OF_PLUGIN" = * ]] ||
[[ ! "$PATH_TO_PLUGIN" = /* ]];
then
echo "You should set"\
" TESTSPACE, PATH_TO_REDMINE, REDMINE_VER"\
" NAME_OF_PLUGIN, PATH_TO_PLUGIN"\
" environment variables"
echo "You set:"\
"$TESTSPACE"\
"$PATH_TO_REDMINE"\
"$REDMINE_VER"\
"$NAME_OF_PLUGIN"\
"$PATH_TO_PLUGIN"
exit 1;
fi

export RAILS_ENV=test

export REDMINE_GIT_REPO=git://github.com/redmine/redmine.git
export REDMINE_GIT_TAG=$REDMINE_VER
export BUNDLE_GEMFILE=$PATH_TO_REDMINE/Gemfile

if [ -f Gemfile_for_test ]
then
cp Gemfile_for_test Gemfile
fi

# checkout redmine
git clone $REDMINE_GIT_REPO $PATH_TO_REDMINE
cp test/fixtures/* ${PATH_TO_REDMINE}/test/fixtures/
cd $PATH_TO_REDMINE
if [ ! "$REDMINE_GIT_TAG" = "master" ];
then
git checkout -b $REDMINE_GIT_TAG origin/$REDMINE_GIT_TAG
fi

# create a link to the backlogs plugin
ln -sf $PATH_TO_PLUGIN plugins/$NAME_OF_PLUGIN


cat << EOS > config/database.yml
test:
adapter: sqlite3
database: db/test.sqlite3
EOS


# install gems
bundle install

# run redmine database migrations
bundle exec rake db:migrate

# run plugin database migrations
bundle exec rake redmine:plugins:migrate

# install redmine database
#bundle exec rake redmine:load_default_data REDMINE_LANG=en

bundle exec rake db:structure:dump

# run tests
# bundle exec rake TEST=test/unit/role_test.rb
bundle exec rake redmine:plugins:test NAME=$NAME_OF_PLUGIN

0 comments on commit 7cf230c

Please sign in to comment.