Merge branch 'master' of dev.gitlabhq.com:gitlabhq into feature/issues_search
This commit is contained in:
commit
0955863489
32 changed files with 262 additions and 179 deletions
|
@ -4,11 +4,15 @@ describe Project do
|
|||
describe "Associations" do
|
||||
it { should have_many(:users) }
|
||||
it { should have_many(:users_projects) }
|
||||
it { should have_many(:issues) }
|
||||
it { should have_many(:notes) }
|
||||
it { should have_many(:snippets) }
|
||||
end
|
||||
|
||||
describe "Validation" do
|
||||
it { should validate_presence_of(:name) }
|
||||
it { should validate_presence_of(:path) }
|
||||
it { should validate_presence_of(:code) }
|
||||
end
|
||||
|
||||
describe "Respond to" do
|
||||
|
@ -31,6 +35,11 @@ describe Project do
|
|||
it { should respond_to(:commit) }
|
||||
end
|
||||
|
||||
it "should not allow 'gitosis-admin' as repo name" do
|
||||
should allow_value("blah").for(:path)
|
||||
should_not allow_value("gitosis-admin").for(:path)
|
||||
end
|
||||
|
||||
it "should return valid url to repo" do
|
||||
project = Project.new(:path => "somewhere")
|
||||
project.url_to_repo.should == "git@localhost:somewhere.git"
|
||||
|
|
|
@ -10,7 +10,9 @@ describe "TeamMembers" do
|
|||
describe "View profile" do
|
||||
it "should be available" do
|
||||
visit(team_project_path(@project))
|
||||
find(:xpath, "//table[@id='team-table']//a[1]").click
|
||||
within "#team-table" do
|
||||
click_link(@user.name)
|
||||
end
|
||||
page.should have_content @user.skype
|
||||
page.should_not have_content 'Twitter'
|
||||
end
|
||||
|
@ -29,19 +31,37 @@ describe "TeamMembers" do
|
|||
|
||||
describe "fill in" do
|
||||
before do
|
||||
check "team_member_read"
|
||||
click_link "Select user"
|
||||
click_link @user_1.name
|
||||
#select @user_1.name, :from => "team_member_user_id"
|
||||
|
||||
within "#team_member_new" do
|
||||
check "team_member_read"
|
||||
check "team_member_write"
|
||||
end
|
||||
end
|
||||
|
||||
it { expect { click_button "Save" }.to change {UsersProject.count}.by(1) }
|
||||
it { expect { click_button "Save";sleep(1) }.to change {UsersProject.count}.by(1) }
|
||||
|
||||
it "should add new member to table" do
|
||||
click_button "Save"
|
||||
@member = UsersProject.last
|
||||
|
||||
page.should_not have_content("Add new member")
|
||||
page.should have_content @user_1.name
|
||||
|
||||
@member.read.should be_true
|
||||
@member.write.should be_true
|
||||
@member.admin.should be_false
|
||||
end
|
||||
|
||||
it "should not allow creation without access selected" do
|
||||
within "#team_member_new" do
|
||||
uncheck "team_member_read"
|
||||
uncheck "team_member_write"
|
||||
uncheck "team_member_admin"
|
||||
end
|
||||
|
||||
expect { click_button "Save" }.to_not change {UsersProject.count}
|
||||
page.should have_content("Please choose at least one Role in the Access list")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue