diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-25 12:46:20 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-25 12:46:20 +0400 |
commit | aa1f1eb680e4328c2cf619a770f1e90f74c41987 (patch) | |
tree | 739d73b52a4e6f97a1e8f27a8206f66550f33904 /spec | |
parent | 097e6053efd973c70c4995784a1abc30e9384008 (diff) | |
parent | d839f6c52571e3b873a05779b1131f7b00670b31 (diff) |
Merge pull request #2746 from gitlabhq/features/teams
New feature: Teams
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/user_team_project_relationships.rb | 9 | ||||
-rw-r--r-- | spec/factories/user_team_user_relationships.rb | 10 | ||||
-rw-r--r-- | spec/factories/user_teams.rb | 9 | ||||
-rw-r--r-- | spec/models/project_team_spec.rb (renamed from spec/models/team_spec.rb) | 2 | ||||
-rw-r--r-- | spec/models/user_team_project_relationship_spec.rb | 5 | ||||
-rw-r--r-- | spec/models/user_team_spec.rb | 5 | ||||
-rw-r--r-- | spec/models/user_team_user_relationship_spec.rb | 5 | ||||
-rw-r--r-- | spec/routing/admin_routing_spec.rb | 14 |
8 files changed, 51 insertions, 8 deletions
diff --git a/spec/factories/user_team_project_relationships.rb b/spec/factories/user_team_project_relationships.rb new file mode 100644 index 00000000000..93c7b57d0fa --- /dev/null +++ b/spec/factories/user_team_project_relationships.rb @@ -0,0 +1,9 @@ +# Read about factories at https://github.com/thoughtbot/factory_girl + +FactoryGirl.define do + factory :user_team_project_relationship do + project + user_team + greatest_access { UsersProject::MASTER } + end +end diff --git a/spec/factories/user_team_user_relationships.rb b/spec/factories/user_team_user_relationships.rb new file mode 100644 index 00000000000..55179f9a45b --- /dev/null +++ b/spec/factories/user_team_user_relationships.rb @@ -0,0 +1,10 @@ +# Read about factories at https://github.com/thoughtbot/factory_girl + +FactoryGirl.define do + factory :user_team_user_relationship do + user + user_team + group_admin false + permission { UsersProject::MASTER } + end +end diff --git a/spec/factories/user_teams.rb b/spec/factories/user_teams.rb new file mode 100644 index 00000000000..f4fe45cbb8a --- /dev/null +++ b/spec/factories/user_teams.rb @@ -0,0 +1,9 @@ +# Read about factories at https://github.com/thoughtbot/factory_girl + +FactoryGirl.define do + factory :user_team do + sequence(:name) { |n| "team#{n}" } + path { name.downcase.gsub(/\s/, '_') } + owner + end +end diff --git a/spec/models/team_spec.rb b/spec/models/project_team_spec.rb index 65ffe13b490..7803811f395 100644 --- a/spec/models/team_spec.rb +++ b/spec/models/project_team_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe Team do +describe ProjectTeam do let(:team) { create(:project).team } describe "Respond to" do diff --git a/spec/models/user_team_project_relationship_spec.rb b/spec/models/user_team_project_relationship_spec.rb new file mode 100644 index 00000000000..81051d59971 --- /dev/null +++ b/spec/models/user_team_project_relationship_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe UserTeamProjectRelationship do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/user_team_spec.rb b/spec/models/user_team_spec.rb new file mode 100644 index 00000000000..2d1b99db6f8 --- /dev/null +++ b/spec/models/user_team_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe UserTeam do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/user_team_user_relationship_spec.rb b/spec/models/user_team_user_relationship_spec.rb new file mode 100644 index 00000000000..309f1975e51 --- /dev/null +++ b/spec/models/user_team_user_relationship_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe UserTeamUserRelationship do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/routing/admin_routing_spec.rb b/spec/routing/admin_routing_spec.rb index fb26bf98d0f..3e0e4bb3883 100644 --- a/spec/routing/admin_routing_spec.rb +++ b/spec/routing/admin_routing_spec.rb @@ -95,20 +95,20 @@ describe Admin::ProjectsController, "routing" do end end -# edit_admin_team_member GET /admin/team_members/:id/edit(.:format) admin/team_members#edit -# admin_team_member PUT /admin/team_members/:id(.:format) admin/team_members#update -# DELETE /admin/team_members/:id(.:format) admin/team_members#destroy -describe Admin::TeamMembersController, "routing" do +# edit_admin_project_member GET /admin/projects/:project_id/members/:id/edit(.:format) admin/projects/members#edit {:id=>/[^\/]+/, :project_id=>/[^\/]+/} +# admin_project_member PUT /admin/projects/:project_id/members/:id(.:format) admin/projects/members#update {:id=>/[^\/]+/, :project_id=>/[^\/]+/} +# DELETE /admin/projects/:project_id/members/:id(.:format) admin/projects/members#destroy {:id=>/[^\/]+/, :project_id=>/[^\/]+/} +describe Admin::Projects::MembersController, "routing" do it "to #edit" do - get("/admin/team_members/1/edit").should route_to('admin/team_members#edit', id: '1') + get("/admin/projects/test/members/1/edit").should route_to('admin/projects/members#edit', project_id: 'test', id: '1') end it "to #update" do - put("/admin/team_members/1").should route_to('admin/team_members#update', id: '1') + put("/admin/projects/test/members/1").should route_to('admin/projects/members#update', project_id: 'test', id: '1') end it "to #destroy" do - delete("/admin/team_members/1").should route_to('admin/team_members#destroy', id: '1') + delete("/admin/projects/test/members/1").should route_to('admin/projects/members#destroy', project_id: 'test', id: '1') end end |