[#345] fix specs; fix project url; fix missing method error
This commit is contained in:
parent
4cf3e931bd
commit
83010eca32
|
@ -1,6 +1,6 @@
|
|||
RosaABF.controller('ProjectScheduleController', ['$scope', '$http', function($scope, $http) {
|
||||
|
||||
// See: Modules::Models::Autostart::AUTOSTART_STATUSES
|
||||
// See: Autostart::AUTOSTART_STATUSES
|
||||
$scope.statuses = {
|
||||
'0': 'autostart_statuses.0',
|
||||
'1': 'autostart_statuses.1',
|
||||
|
|
|
@ -26,7 +26,7 @@ module EventLoggable
|
|||
end
|
||||
end
|
||||
|
||||
def destroying_event
|
||||
def log_destroying_event
|
||||
ActiveSupport::Notifications.instrument(self.class.name, eventable: self)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -65,7 +65,7 @@ class GitHook
|
|||
end
|
||||
|
||||
def self.process(*args)
|
||||
create_notifications(args.size > 1 ? GitHook.new(*args) : args.first)
|
||||
Feed::Git.create_notifications(args.size > 1 ? GitHook.new(*args) : args.first)
|
||||
end
|
||||
|
||||
def find_user(user)
|
||||
|
|
|
@ -161,7 +161,7 @@ class Project < ActiveRecord::Base
|
|||
def git_project_address auth_user
|
||||
opts = default_url_options
|
||||
opts.merge!({user: auth_user.authentication_token, password: ''}) unless self.public?
|
||||
Rails.application.routes.url_helpers.project_url(self.owner.uname, self.name, opts) + '.git'
|
||||
Rails.application.routes.url_helpers.project_url(self.name_with_owner, opts) + '.git'
|
||||
#path #share by NFS
|
||||
end
|
||||
|
||||
|
|
|
@ -208,17 +208,17 @@ describe Project do
|
|||
it { repository.platform.platform_arch_settings.should have(2).item }
|
||||
|
||||
context 'once_a_12_hours' do
|
||||
before { project.update_attributes(autostart_status: Modules::Models::Autostart::ONCE_A_12_HOURS) }
|
||||
before { project.update_attributes(autostart_status: Autostart::ONCE_A_12_HOURS) }
|
||||
it_should_behave_like 'autostart build_lists', 1, 0, 0
|
||||
end
|
||||
|
||||
context 'once_a_day' do
|
||||
before { project.update_attributes(autostart_status: Modules::Models::Autostart::ONCE_A_DAY) }
|
||||
before { project.update_attributes(autostart_status: Autostart::ONCE_A_DAY) }
|
||||
it_should_behave_like 'autostart build_lists', 0, 1, 0
|
||||
end
|
||||
|
||||
context 'once_a_day' do
|
||||
before { project.update_attributes(autostart_status: Modules::Models::Autostart::ONCE_A_WEEK) }
|
||||
before { project.update_attributes(autostart_status: Autostart::ONCE_A_WEEK) }
|
||||
it_should_behave_like 'autostart build_lists', 0, 0, 1
|
||||
end
|
||||
|
||||
|
@ -232,7 +232,7 @@ describe Project do
|
|||
|
||||
before do
|
||||
repositories = [repository, main_repository] # 1
|
||||
|
||||
|
||||
# Create 1 main platforms with main repositories
|
||||
repositories << FactoryGirl.create(:repository, name: 'main') # 2
|
||||
# Create platform without main repository
|
||||
|
@ -242,7 +242,7 @@ describe Project do
|
|||
r.platform.update_attributes(visibility: 'hidden')
|
||||
repositories << r # 3
|
||||
|
||||
# Without access to hidden platform
|
||||
# Without access to hidden platform
|
||||
r = FactoryGirl.create(:repository, name: 'main')
|
||||
r.platform.update_attributes(visibility: 'hidden')
|
||||
|
||||
|
@ -266,20 +266,18 @@ describe Project do
|
|||
# into main platforms: 2 + 1(hidden)
|
||||
# into personal platform: 3(main) * 1
|
||||
context 'once_a_12_hours' do
|
||||
before { project.update_attributes(autostart_status: Modules::Models::Autostart::ONCE_A_12_HOURS) }
|
||||
before { project.update_attributes(autostart_status: Autostart::ONCE_A_12_HOURS) }
|
||||
it_should_behave_like 'autostart build_lists', 6, 0, 0
|
||||
end
|
||||
|
||||
context 'once_a_day' do
|
||||
before { project.update_attributes(autostart_status: Modules::Models::Autostart::ONCE_A_DAY) }
|
||||
before { project.update_attributes(autostart_status: Autostart::ONCE_A_DAY) }
|
||||
it_should_behave_like 'autostart build_lists', 0, 6, 0
|
||||
end
|
||||
|
||||
context 'once_a_day' do
|
||||
before { project.update_attributes(autostart_status: Modules::Models::Autostart::ONCE_A_WEEK) }
|
||||
before { project.update_attributes(autostart_status: Autostart::ONCE_A_WEEK) }
|
||||
it_should_behave_like 'autostart build_lists', 0, 0, 6
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue