browse_files.rb 1.33 KB
Newer Older
1
class ProjectBrowseFiles < Spinach::FeatureSteps
Nihad Abbasov's avatar
Nihad Abbasov committed
2 3 4 5
  include SharedAuthentication
  include SharedProject
  include SharedPaths

6
  step 'I should see files from repository' do
7
    page.should have_content "app"
8
    page.should have_content "history"
9 10 11
    page.should have_content "Gemfile"
  end

12
  step 'I should see files from repository for "8470d70"' do
13
    current_path.should == project_tree_path(@project, "8470d70")
14
    page.should have_content "app"
15
    page.should have_content "history"
16 17 18
    page.should have_content "Gemfile"
  end

19
  step 'I click on "Gemfile.lock" file in repo' do
20
    click_link "Gemfile.lock"
21 22
  end

23
  step 'I should see it content' do
24
    page.should have_content "DEPENDENCIES"
25 26
  end

27
  step 'I click link "raw"' do
28 29 30
    click_link "raw"
  end

31
  step 'I should see raw file content' do
32 33
    page.source.should == ValidCommit::BLOB_FILE
  end
Valeriy Sizov's avatar
Valeriy Sizov committed
34

35
  step 'I click button "edit"' do
36
    click_link 'edit'
Valeriy Sizov's avatar
Valeriy Sizov committed
37 38
  end

39
  step 'I can edit code' do
Valeriy Sizov's avatar
Valeriy Sizov committed
40 41 42 43
    page.execute_script('editor.setValue("GitlabFileEditor")')
    page.evaluate_script('editor.getValue()').should == "GitlabFileEditor"
  end

44 45 46 47 48 49 50 51 52
  step 'I click on "new file" link in repo' do
    click_link 'new-file-link'
  end

  step 'I can see new file page' do
    page.should have_content "New file"
    page.should have_content "File name"
    page.should have_content "Commit message"
  end
53
end