Commit bb2f4d66 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix browse code spinach tests

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 830eaa7f
...@@ -8,11 +8,11 @@ Feature: Project Browse files ...@@ -8,11 +8,11 @@ Feature: Project Browse files
Then I should see files from repository Then I should see files from repository
Scenario: I browse files for specific ref Scenario: I browse files for specific ref
Given I visit project source page for "8470d70" Given I visit project source page for "6d39438"
Then I should see files from repository for "8470d70" Then I should see files from repository for "6d39438"
Scenario: I browse file content Scenario: I browse file content
Given I click on "Gemfile.lock" file in repo Given I click on ".gitignore" file in repo
Then I should see it content Then I should see it content
Scenario: I browse raw file Scenario: I browse raw file
...@@ -26,20 +26,20 @@ Feature: Project Browse files ...@@ -26,20 +26,20 @@ Feature: Project Browse files
@javascript @javascript
Scenario: I can edit file Scenario: I can edit file
Given I click on "Gemfile.lock" file in repo Given I click on ".gitignore" file in repo
And I click button "edit" And I click button "edit"
Then I can edit code Then I can edit code
@javascript @javascript
Scenario: I can see editing preview Scenario: I can see editing preview
Given I click on "Gemfile.lock" file in repo Given I click on ".gitignore" file in repo
And I click button "edit" And I click button "edit"
And I edit code And I edit code
And I click link "Diff" And I click link "Diff"
Then I see diff Then I see diff
Scenario: I can browse directory with Browse Dir Scenario: I can browse directory with Browse Dir
Given I click on app directory Given I click on files directory
And I click on history link And I click on history link
Then I see Browse dir link Then I see Browse dir link
......
...@@ -5,6 +5,6 @@ Feature: Project Browse git repo ...@@ -5,6 +5,6 @@ Feature: Project Browse git repo
Given I visit project source page Given I visit project source page
Scenario: I blame file Scenario: I blame file
Given I click on "Gemfile.lock" file in repo Given I click on ".gitignore" file in repo
And I click blame button And I click blame button
Then I should see git file blame Then I should see git file blame
...@@ -2,7 +2,7 @@ Feature: Project Multiselect Blob ...@@ -2,7 +2,7 @@ Feature: Project Multiselect Blob
Background: Background:
Given I sign in as a user Given I sign in as a user
And I own project "Shop" And I own project "Shop"
And I visit "Gemfile.lock" file in repo And I visit ".gitignore" file in repo
@javascript @javascript
Scenario: I click line 1 in file Scenario: I click line 1 in file
......
...@@ -4,6 +4,6 @@ Feature: Project Search code ...@@ -4,6 +4,6 @@ Feature: Project Search code
And I own project "Shop" And I own project "Shop"
Given I visit project source page Given I visit project source page
Scenario: Search for term "Welcome to GitLab" Scenario: Search for term "coffee"
When I search for term "Welcome to GitLab" When I search for term "coffee"
Then I should see files from repository containing "Welcome to GitLab" Then I should see files from repository containing "coffee"
...@@ -4,24 +4,23 @@ class ProjectBrowseFiles < Spinach::FeatureSteps ...@@ -4,24 +4,23 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
include SharedPaths include SharedPaths
step 'I should see files from repository' do step 'I should see files from repository' do
page.should have_content "app" page.should have_content "VERSION"
page.should have_content "history" page.should have_content ".gitignore"
page.should have_content "Gemfile" page.should have_content "LICENSE"
end end
step 'I should see files from repository for "8470d70"' do step 'I should see files from repository for "6d39438"' do
current_path.should == project_tree_path(@project, "8470d70") current_path.should == project_tree_path(@project, "6d39438")
page.should have_content "app" page.should have_content ".gitignore"
page.should have_content "history" page.should have_content "LICENSE"
page.should have_content "Gemfile"
end end
step 'I click on "Gemfile.lock" file in repo' do step 'I click on ".gitignore" file in repo' do
click_link "Gemfile.lock" click_link ".gitignore"
end end
step 'I should see it content' do step 'I should see it content' do
page.should have_content "DEPENDENCIES" page.should have_content "*.rbc"
end end
step 'I click link "raw"' do step 'I click link "raw"' do
...@@ -63,8 +62,8 @@ class ProjectBrowseFiles < Spinach::FeatureSteps ...@@ -63,8 +62,8 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
page.should have_content "Commit message" page.should have_content "Commit message"
end end
step 'I click on app directory' do step 'I click on files directory' do
click_link 'app' click_link 'files'
end end
step 'I click on history link' do step 'I click on history link' do
......
...@@ -3,8 +3,8 @@ class ProjectBrowseGitRepo < Spinach::FeatureSteps ...@@ -3,8 +3,8 @@ class ProjectBrowseGitRepo < Spinach::FeatureSteps
include SharedProject include SharedProject
include SharedPaths include SharedPaths
Given 'I click on "Gemfile.lock" file in repo' do Given 'I click on ".gitignore" file in repo' do
click_link "Gemfile.lock" click_link ".gitignore"
end end
And 'I click blame button' do And 'I click blame button' do
...@@ -12,8 +12,8 @@ class ProjectBrowseGitRepo < Spinach::FeatureSteps ...@@ -12,8 +12,8 @@ class ProjectBrowseGitRepo < Spinach::FeatureSteps
end end
Then 'I should see git file blame' do Then 'I should see git file blame' do
page.should have_content "DEPENDENCIES" page.should have_content "*.rb"
page.should have_content "Dmitriy Zaporozhets" page.should have_content "Dmitriy Zaporozhets"
page.should have_content "Moving to rails 3.2" page.should have_content "Initial commit"
end end
end end
...@@ -52,7 +52,7 @@ class ProjectMultiselectBlob < Spinach::FeatureSteps ...@@ -52,7 +52,7 @@ class ProjectMultiselectBlob < Spinach::FeatureSteps
page.evaluate_script("window.history.forward()") page.evaluate_script("window.history.forward()")
end end
step 'I click on "Gemfile.lock" file in repo' do step 'I click on ".gitignore" file in repo' do
click_link "Gemfile.lock" click_link ".gitignore"
end end
end end
...@@ -3,15 +3,14 @@ class ProjectSearchCode < Spinach::FeatureSteps ...@@ -3,15 +3,14 @@ class ProjectSearchCode < Spinach::FeatureSteps
include SharedProject include SharedProject
include SharedPaths include SharedPaths
When 'I search for term "Welcome to GitLab"' do When 'I search for term "coffee"' do
fill_in "search", with: "Welcome to GitLab" fill_in "search", with: "coffee"
click_button "Go" click_button "Go"
click_link 'Repository Code' click_link 'Repository Code'
end end
Then 'I should see files from repository containing "Welcome to GitLab"' do Then 'I should see files from repository containing "coffee"' do
page.should have_content "Welcome to GitLab" page.should have_content "coffee"
page.should have_content "GitLab is a free project and repository management application" page.should have_content " CONTRIBUTING.md"
end end
end end
...@@ -260,12 +260,12 @@ module SharedPaths ...@@ -260,12 +260,12 @@ module SharedPaths
visit project_blob_path(@project, File.join(ValidCommit::ID, ValidCommit::BLOB_FILE_PATH)) visit project_blob_path(@project, File.join(ValidCommit::ID, ValidCommit::BLOB_FILE_PATH))
end end
step 'I visit "Gemfile.lock" file in repo' do step 'I visit ".gitignore" file in repo' do
visit project_blob_path(@project, File.join(root_ref, 'Gemfile.lock')) visit project_blob_path(@project, File.join(root_ref, '.gitignore'))
end end
step 'I visit project source page for "8470d70"' do step 'I visit project source page for "6d39438"' do
visit project_tree_path(@project, "8470d70") visit project_tree_path(@project, "6d39438")
end end
step 'I visit project tags page' do step 'I visit project tags page' do
......
module ValidCommit module ValidCommit
ID = "8470d70da67355c9c009e4401746b1d5410af2e3" ID = "570e7b2abdd848b95f2f578043fc23bd6f6fd24d"
MESSAGE = "notes controller refactored" MESSAGE = <<eos
Change some files
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
eos
AUTHOR_FULL_NAME = "Dmitriy Zaporozhets" AUTHOR_FULL_NAME = "Dmitriy Zaporozhets"
AUTHOR_EMAIL = "dmitriy.zaporozhets@gmail.com" AUTHOR_EMAIL = "dmitriy.zaporozhets@gmail.com"
...@@ -10,7 +13,15 @@ module ValidCommit ...@@ -10,7 +13,15 @@ module ValidCommit
C_FILE_PATH = "app/models" C_FILE_PATH = "app/models"
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"] 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 = %{%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 = <<eos
BLOB_FILE_PATH = "app/views/keys/show.html.haml" class Commit
constructor: ->
$('.files .diff-file').each ->
new CommitFile(this)
@Commit = Commit
eos
BLOB_FILE_PATH = "files/js/commit.js.coffee"
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment