Fix browse code spinach tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
830eaa7f4e
commit
bb2f4d665e
10 changed files with 53 additions and 44 deletions
|
@ -8,11 +8,11 @@ Feature: Project Browse files
|
|||
Then I should see files from repository
|
||||
|
||||
Scenario: I browse files for specific ref
|
||||
Given I visit project source page for "8470d70"
|
||||
Then I should see files from repository for "8470d70"
|
||||
Given I visit project source page for "6d39438"
|
||||
Then I should see files from repository for "6d39438"
|
||||
|
||||
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
|
||||
|
||||
Scenario: I browse raw file
|
||||
|
@ -26,20 +26,20 @@ Feature: Project Browse files
|
|||
|
||||
@javascript
|
||||
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"
|
||||
Then I can edit code
|
||||
|
||||
@javascript
|
||||
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 edit code
|
||||
And I click link "Diff"
|
||||
Then I see diff
|
||||
|
||||
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
|
||||
Then I see Browse dir link
|
||||
|
||||
|
|
|
@ -5,6 +5,6 @@ Feature: Project Browse git repo
|
|||
Given I visit project source page
|
||||
|
||||
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
|
||||
Then I should see git file blame
|
||||
|
|
|
@ -2,7 +2,7 @@ Feature: Project Multiselect Blob
|
|||
Background:
|
||||
Given I sign in as a user
|
||||
And I own project "Shop"
|
||||
And I visit "Gemfile.lock" file in repo
|
||||
And I visit ".gitignore" file in repo
|
||||
|
||||
@javascript
|
||||
Scenario: I click line 1 in file
|
||||
|
|
|
@ -4,6 +4,6 @@ Feature: Project Search code
|
|||
And I own project "Shop"
|
||||
Given I visit project source page
|
||||
|
||||
Scenario: Search for term "Welcome to GitLab"
|
||||
When I search for term "Welcome to GitLab"
|
||||
Then I should see files from repository containing "Welcome to GitLab"
|
||||
Scenario: Search for term "coffee"
|
||||
When I search for term "coffee"
|
||||
Then I should see files from repository containing "coffee"
|
||||
|
|
|
@ -4,24 +4,23 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
|
|||
include SharedPaths
|
||||
|
||||
step 'I should see files from repository' do
|
||||
page.should have_content "app"
|
||||
page.should have_content "history"
|
||||
page.should have_content "Gemfile"
|
||||
page.should have_content "VERSION"
|
||||
page.should have_content ".gitignore"
|
||||
page.should have_content "LICENSE"
|
||||
end
|
||||
|
||||
step 'I should see files from repository for "8470d70"' do
|
||||
current_path.should == project_tree_path(@project, "8470d70")
|
||||
page.should have_content "app"
|
||||
page.should have_content "history"
|
||||
page.should have_content "Gemfile"
|
||||
step 'I should see files from repository for "6d39438"' do
|
||||
current_path.should == project_tree_path(@project, "6d39438")
|
||||
page.should have_content ".gitignore"
|
||||
page.should have_content "LICENSE"
|
||||
end
|
||||
|
||||
step 'I click on "Gemfile.lock" file in repo' do
|
||||
click_link "Gemfile.lock"
|
||||
step 'I click on ".gitignore" file in repo' do
|
||||
click_link ".gitignore"
|
||||
end
|
||||
|
||||
step 'I should see it content' do
|
||||
page.should have_content "DEPENDENCIES"
|
||||
page.should have_content "*.rbc"
|
||||
end
|
||||
|
||||
step 'I click link "raw"' do
|
||||
|
@ -63,8 +62,8 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
|
|||
page.should have_content "Commit message"
|
||||
end
|
||||
|
||||
step 'I click on app directory' do
|
||||
click_link 'app'
|
||||
step 'I click on files directory' do
|
||||
click_link 'files'
|
||||
end
|
||||
|
||||
step 'I click on history link' do
|
||||
|
|
|
@ -3,8 +3,8 @@ class ProjectBrowseGitRepo < Spinach::FeatureSteps
|
|||
include SharedProject
|
||||
include SharedPaths
|
||||
|
||||
Given 'I click on "Gemfile.lock" file in repo' do
|
||||
click_link "Gemfile.lock"
|
||||
Given 'I click on ".gitignore" file in repo' do
|
||||
click_link ".gitignore"
|
||||
end
|
||||
|
||||
And 'I click blame button' do
|
||||
|
@ -12,8 +12,8 @@ class ProjectBrowseGitRepo < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
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 "Moving to rails 3.2"
|
||||
page.should have_content "Initial commit"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -52,7 +52,7 @@ class ProjectMultiselectBlob < Spinach::FeatureSteps
|
|||
page.evaluate_script("window.history.forward()")
|
||||
end
|
||||
|
||||
step 'I click on "Gemfile.lock" file in repo' do
|
||||
click_link "Gemfile.lock"
|
||||
step 'I click on ".gitignore" file in repo' do
|
||||
click_link ".gitignore"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,15 +3,14 @@ class ProjectSearchCode < Spinach::FeatureSteps
|
|||
include SharedProject
|
||||
include SharedPaths
|
||||
|
||||
When 'I search for term "Welcome to GitLab"' do
|
||||
fill_in "search", with: "Welcome to GitLab"
|
||||
When 'I search for term "coffee"' do
|
||||
fill_in "search", with: "coffee"
|
||||
click_button "Go"
|
||||
click_link 'Repository Code'
|
||||
end
|
||||
|
||||
Then 'I should see files from repository containing "Welcome to GitLab"' do
|
||||
page.should have_content "Welcome to GitLab"
|
||||
page.should have_content "GitLab is a free project and repository management application"
|
||||
Then 'I should see files from repository containing "coffee"' do
|
||||
page.should have_content "coffee"
|
||||
page.should have_content " CONTRIBUTING.md"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -260,12 +260,12 @@ module SharedPaths
|
|||
visit project_blob_path(@project, File.join(ValidCommit::ID, ValidCommit::BLOB_FILE_PATH))
|
||||
end
|
||||
|
||||
step 'I visit "Gemfile.lock" file in repo' do
|
||||
visit project_blob_path(@project, File.join(root_ref, 'Gemfile.lock'))
|
||||
step 'I visit ".gitignore" file in repo' do
|
||||
visit project_blob_path(@project, File.join(root_ref, '.gitignore'))
|
||||
end
|
||||
|
||||
step 'I visit project source page for "8470d70"' do
|
||||
visit project_tree_path(@project, "8470d70")
|
||||
step 'I visit project source page for "6d39438"' do
|
||||
visit project_tree_path(@project, "6d39438")
|
||||
end
|
||||
|
||||
step 'I visit project tags page' do
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
module ValidCommit
|
||||
ID = "8470d70da67355c9c009e4401746b1d5410af2e3"
|
||||
MESSAGE = "notes controller refactored"
|
||||
ID = "570e7b2abdd848b95f2f578043fc23bd6f6fd24d"
|
||||
MESSAGE = <<eos
|
||||
Change some files
|
||||
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
|
||||
eos
|
||||
AUTHOR_FULL_NAME = "Dmitriy Zaporozhets"
|
||||
AUTHOR_EMAIL = "dmitriy.zaporozhets@gmail.com"
|
||||
|
||||
|
@ -10,7 +13,15 @@ module ValidCommit
|
|||
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"]
|
||||
|
||||
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"
|
||||
BLOB_FILE = <<eos
|
||||
class Commit
|
||||
constructor: ->
|
||||
$('.files .diff-file').each ->
|
||||
new CommitFile(this)
|
||||
|
||||
@Commit = Commit
|
||||
eos
|
||||
|
||||
BLOB_FILE_PATH = "files/js/commit.js.coffee"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue