Comments cucumber. More refactoring. Cucumber -> branches, tags
This commit is contained in:
parent
1281c122c7
commit
9844ddd43f
16 changed files with 80 additions and 192 deletions
|
@ -1,28 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "Issues" do
|
||||
let(:project) { Factory :project }
|
||||
let!(:commit) { project.repo.commits.first }
|
||||
|
||||
before do
|
||||
login_as :user
|
||||
project.add_access(@user, :read, :write)
|
||||
end
|
||||
|
||||
describe "add new note", :js => true do
|
||||
before do
|
||||
visit project_commit_path(project, commit)
|
||||
fill_in "note_note", :with => "I commented this commit"
|
||||
click_button "Add Comment"
|
||||
end
|
||||
|
||||
it "should conatin new note" do
|
||||
page.should have_content("I commented this commit")
|
||||
end
|
||||
|
||||
it "should be displayed when i visit this commit again" do
|
||||
visit project_commit_path(project, commit)
|
||||
page.should have_content("I commented this commit")
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,49 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "Repository" do
|
||||
|
||||
before do
|
||||
@user = Factory :user
|
||||
@project = Factory :project
|
||||
@project.add_access(@user, :read, :write)
|
||||
login_with @user
|
||||
end
|
||||
|
||||
describe "GET /:project_name/repository" do
|
||||
before do
|
||||
visit project_repository_path(@project)
|
||||
end
|
||||
|
||||
it "should be on projects page" do
|
||||
current_path.should == project_repository_path(@project)
|
||||
end
|
||||
|
||||
it "should have link to last commit for activities tab" do
|
||||
page.should have_content(@project.commit.safe_message[0..20])
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET /:project_name/repository/branches" do
|
||||
before do
|
||||
visit branches_project_repository_path(@project)
|
||||
end
|
||||
|
||||
it "should have link to repo activities" do
|
||||
page.should have_content("Branches")
|
||||
page.should have_content("master")
|
||||
end
|
||||
end
|
||||
|
||||
# TODO: Add new repo to seeds with tags list
|
||||
describe "GET /:project_name/repository/tags" do
|
||||
before do
|
||||
visit tags_project_repository_path(@project)
|
||||
end
|
||||
|
||||
it "should have link to repo activities" do
|
||||
page.should have_content("Tags")
|
||||
page.should have_content("v1.2.1")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -7,9 +7,6 @@ describe "Users Security" do
|
|||
end
|
||||
|
||||
describe "GET /login" do
|
||||
#it { new_user_session_path.should be_denied_for @u1 }
|
||||
#it { new_user_session_path.should be_denied_for :admin }
|
||||
#it { new_user_session_path.should be_denied_for :user }
|
||||
it { new_user_session_path.should_not be_404_for :visitor }
|
||||
end
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "TeamMembers" do
|
||||
before do
|
||||
login_as :user
|
||||
@project = Factory :project
|
||||
@project.add_access(@user, :read, :admin)
|
||||
end
|
||||
|
||||
describe "Update profile", :js => true do
|
||||
it "should update user role" do
|
||||
@project.master_access_for?(@user).should be_true
|
||||
visit team_project_path(@project)
|
||||
select "Developer", :from => "team_member_project_access"
|
||||
@project.master_access_for?(@user).should be_false
|
||||
@project.dev_access_for?(@user).should be_true
|
||||
end
|
||||
end
|
||||
|
||||
describe "View profile" do
|
||||
it "should be available" do
|
||||
visit(team_project_path(@project))
|
||||
click_link(@user.name)
|
||||
page.should have_content @user.skype
|
||||
page.should_not have_content 'Twitter'
|
||||
end
|
||||
end
|
||||
|
||||
describe "New Team member" do
|
||||
before do
|
||||
@user_1 = Factory :user
|
||||
visit team_project_path(@project)
|
||||
click_link "New Team Member"
|
||||
end
|
||||
|
||||
it "should open new team member popup" do
|
||||
page.should have_content("New Team member")
|
||||
end
|
||||
|
||||
describe "fill in" do
|
||||
before do
|
||||
within "#new_team_member" do
|
||||
select @user_1.name, :from => "team_member_user_id"
|
||||
select "Reporter", :from => "team_member_project_access"
|
||||
end
|
||||
end
|
||||
|
||||
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 have_content @user_1.name
|
||||
|
||||
@member.reload
|
||||
@member.project_access.should == UsersProject::REPORTER
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "Cancel membership" do
|
||||
it "should cancel membership" do
|
||||
visit project_team_member_path(@project, @project.users_projects.last)
|
||||
expect { click_link "Remove from team" }.to change { UsersProject.count }.by(-1)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,29 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "Wikis" do
|
||||
let(:project) { Factory :project }
|
||||
|
||||
before do
|
||||
login_as :user
|
||||
project.add_access(@user, :read, :write)
|
||||
end
|
||||
|
||||
describe "add new note", :js => true do
|
||||
before do
|
||||
visit project_wiki_path(project, :index)
|
||||
|
||||
fill_in "Title", :with => 'Test title'
|
||||
fill_in "Content", :with => '[link test](test)'
|
||||
click_on "Save"
|
||||
|
||||
page.should have_content("Test title")
|
||||
|
||||
fill_in "note_note", :with => "Comment on wiki!"
|
||||
click_button "Add Comment"
|
||||
end
|
||||
|
||||
it "should contain the new note" do
|
||||
page.should have_content("Comment on wiki!")
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue