Rspec test repo replaced.\nMerge Requests improved

This commit is contained in:
Dmitriy Zaporozhets 2012-03-13 23:54:49 +02:00
parent 781f5aa6fb
commit 3676838dc9
18 changed files with 90 additions and 41 deletions

View file

@ -2,14 +2,14 @@ require File.join(Rails.root, 'spec', 'factory')
Factory.add(:project, Project) do |obj|
obj.name = Faker::Internet.user_name
obj.path = 'legit'
obj.path = 'gitlabhq'
obj.owner = Factory(:user)
obj.code = 'LGT'
end
Factory.add(:public_project, Project) do |obj|
obj.name = Faker::Internet.user_name
obj.path = 'legit'
obj.path = 'gitlabhq'
obj.private_flag = false
obj.owner = Factory(:user)
obj.code = 'LGT'
@ -41,7 +41,7 @@ Factory.add(:merge_request, MergeRequest) do |obj|
obj.author = Factory :user
obj.assignee = Factory :user
obj.source_branch = "master"
obj.target_branch = "master"
obj.target_branch = "stable"
obj.closed = false
end

View file

@ -54,7 +54,7 @@ describe Note do
describe :authorization do
before do
@p1 = project
@p2 = Factory :project, :code => "alien", :path => "legit_1"
@p2 = Factory :project, :code => "alien", :path => "gitlabhq_1"
@u1 = Factory :user
@u2 = Factory :user
@u3 = Factory :user

View file

@ -86,23 +86,22 @@ describe Project do
let(:project) { Factory :project }
it { project.fresh_commits(3).count.should == 3 }
it { project.fresh_commits.first.id.should == "2fb376f61875b58bceee0492e270e9c805294b1a" }
it { project.fresh_commits.last.id.should == "0dac878dbfe0b9c6104a87d65fe999149a8d862c" }
it { project.fresh_commits.first.id.should == "bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a" }
it { project.fresh_commits.last.id.should == "f403da73f5e62794a0447aca879360494b08f678" }
end
describe "commits_between" do
let(:project) { Factory :project }
subject do
commits = project.commits_between("a6d1d4aca0c85816ddfd27d93773f43a31395033",
"2fb376f61875b58bceee0492e270e9c805294b1a")
commits = project.commits_between("3a4b4fb4cde7809f033822a171b9feae19d41fff",
"8470d70da67355c9c009e4401746b1d5410af2e3")
commits.map { |c| c.id }
end
it { should have(2).elements }
it { should include("2fb376f61875b58bceee0492e270e9c805294b1a") }
it { should include("4571e226fbcd7be1af16e9fa1e13b7ac003bebdf") }
it { should_not include("a6d1d4aca0c85816ddfd27d93773f43a31395033") }
it { should have(3).elements }
it { should include("f0f14c8eaba69ebddd766498a9d0b0e79becd633") }
it { should_not include("bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a") }
end
describe "Git methods" do

View file

@ -87,7 +87,7 @@ describe "Admin::Projects" do
visit new_admin_project_path
fill_in 'Name', :with => 'NewProject'
fill_in 'Code', :with => 'NPR'
fill_in 'Path', :with => 'legit_1'
fill_in 'Path', :with => 'gitlabhq_1'
expect { click_button "Save" }.to change { Project.count }.by(1)
@project = Project.last
end

View file

@ -52,7 +52,7 @@ describe "MergeRequests" do
visit new_project_merge_request_path(project)
fill_in "merge_request_title", :with => "Merge Request Title"
select "master", :from => "merge_request_source_branch"
select "master", :from => "merge_request_target_branch"
select "stable", :from => "merge_request_target_branch"
select @user.name, :from => "merge_request_assignee_id"
click_button "Save"
end

View file

@ -134,7 +134,7 @@ describe "Projects" do
visit edit_project_path(@project)
fill_in 'Name', :with => 'Awesome'
fill_in 'Path', :with => 'legit'
fill_in 'Path', :with => 'gitlabhq'
fill_in 'Description', :with => 'Awesome project'
click_button "Save"
@project = @project.reload

View file

@ -57,7 +57,7 @@ describe "Projects" do
@project = Factory :project
@project.add_access(@user, :read)
visit tree_project_ref_path(@project, @project.root_ref, :path => ".rvmrc")
visit tree_project_ref_path(@project, @project.root_ref, :path => "Gemfile")
end
it "should be correct path" do
@ -65,7 +65,7 @@ describe "Projects" do
end
it "should contain file view" do
page.should have_content("rvm use 1.9.2@legit")
page.should have_content("rubygems.org")
end
end
end

View file

@ -42,7 +42,7 @@ describe "Repository" do
it "should have link to repo activities" do
page.should have_content("Tags")
page.should have_content("No tags")
page.should have_content("v1.2.1")
end
end
end

Binary file not shown.

View file

@ -1,25 +1,15 @@
module ValidCommit
ID = "eaffbe556ec3a8dc84ef15892a9f12d84dde7e1d"
MESSAGE = "style"
ID = "8470d70da67355c9c009e4401746b1d5410af2e3"
MESSAGE = "notes controller refactored"
AUTHOR_FULL_NAME = "Dmitriy Zaporozhets"
FILES = [".gitignore", ".rspec", ".rvmrc", "Gemfile", "Gemfile.lock", "LICENSE", "README.rdoc", "Rakefile", "app", "config.ru", "config", "db", "doc", "lib", "log", "public", "script", "spec", "vendor"]
FILES_COUNT = 19
FILES = [".foreman", ".gitignore", ".rails_footnotes", ".rspec", ".travis.yml", "CHANGELOG", "Gemfile", "Gemfile.lock", "LICENSE", "Procfile", "Procfile.production", "README.md", "Rakefile", "VERSION", "app", "config.ru", "config", "db", "doc", "lib", "log", "public", "resque.sh", "script", "spec", "vendor"]
FILES_COUNT = 26
C_FILE_PATH = "app/models"
C_FILES = [".gitkeep", "project.rb", "user.rb"]
C_FILES = [".gitkeep", "ability.rb", "commit.rb", "issue.rb", "key.rb", "mailer_observer.rb", "merge_request.rb", "note.rb", "project.rb", "protected_branch.rb", "repository.rb", "snippet.rb", "tree.rb", "user.rb", "users_project.rb", "web_hook.rb", "wiki.rb"]
BLOB_FILE = <<-blob
<div class="span-14 colborder">
<h2>Tree / <%= link_to "Commits", project_commits_path(@project) %></h2>
<%= render :partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @commit.tree} %>
</div>
<div class="span-8 right">
<%= render "side_panel" %>
</div>
blob
BLOB_FILE_PATH = "app/views/projects/show.html.erb"
BLOB_FILE = %{%h3= @key.title\n%hr\n%pre= @key.key\n.actions\n = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => \"btn danger delete-key\"\n\n\n}
BLOB_FILE_PATH = "app/views/keys/show.html.haml"
end