paths.rb 6.23 KB
Newer Older
Nihad Abbasov's avatar
Nihad Abbasov committed
1 2 3
module SharedPaths
  include Spinach::DSL

4 5 6 7
  When 'I visit new project page' do
    visit new_project_path
  end

randx's avatar
randx committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
  # ----------------------------------------
  # Group
  # ----------------------------------------

  When 'I visit group page' do
    visit group_path(current_group)
  end

  When 'I visit group issues page' do
    visit issues_group_path(current_group)
  end

  When 'I visit group merge requests page' do
    visit merge_requests_group_path(current_group)
  end

24 25 26 27
  When 'I visit group people page' do
    visit people_group_path(current_group)
  end

28 29 30 31
  When 'I visit group settings page' do
    visit edit_group_path(current_group)
  end

32 33 34 35 36 37 38 39
  # ----------------------------------------
  # Dashboard
  # ----------------------------------------

  Given 'I visit dashboard page' do
    visit dashboard_path
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
40 41 42 43
  Given 'I visit dashboard projects page' do
    visit projects_dashboard_path
  end

44
  Given 'I visit dashboard issues page' do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
45
    visit issues_dashboard_path
Nihad Abbasov's avatar
Nihad Abbasov committed
46 47
  end

48
  Given 'I visit dashboard merge requests page' do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
49
    visit merge_requests_dashboard_path
Nihad Abbasov's avatar
Nihad Abbasov committed
50 51
  end

52 53
  Given 'I visit dashboard search page' do
    visit search_path
Nihad Abbasov's avatar
Nihad Abbasov committed
54 55
  end

56 57
  Given 'I visit dashboard help page' do
    visit help_path
Nihad Abbasov's avatar
Nihad Abbasov committed
58 59
  end

60 61 62 63
  # ----------------------------------------
  # Profile
  # ----------------------------------------

Nihad Abbasov's avatar
Nihad Abbasov committed
64 65 66 67
  Given 'I visit profile page' do
    visit profile_path
  end

68
  Given 'I visit profile account page' do
69
    visit account_profile_path
Nihad Abbasov's avatar
Nihad Abbasov committed
70 71
  end

72 73 74 75 76
  Given 'I visit profile SSH keys page' do
    visit keys_path
  end

  Given 'I visit profile design page' do
77
    visit design_profile_path
78 79 80
  end

  Given 'I visit profile history page' do
81
    visit history_profile_path
Nihad Abbasov's avatar
Nihad Abbasov committed
82 83
  end

84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
  # ----------------------------------------
  # Admin
  # ----------------------------------------

  Given 'I visit admin page' do
    visit admin_root_path
  end

  Given 'I visit admin projects page' do
    visit admin_projects_path
  end

  Given 'I visit admin users page' do
    visit admin_users_path
  end

  Given 'I visit admin logs page' do
    visit admin_logs_path
  end

  Given 'I visit admin hooks page' do
    visit admin_hooks_path
  end

  Given 'I visit admin Resque page' do
    visit admin_resque_path
  end

randx's avatar
randx committed
112 113 114 115
  And 'I visit admin groups page' do
    visit admin_groups_path
  end

Andrey Kumanyaev's avatar
Andrey Kumanyaev committed
116 117 118 119
  When 'I visit admin teams page' do
    visit admin_teams_path
  end

120 121 122 123 124 125 126 127
  # ----------------------------------------
  # Generic Project
  # ----------------------------------------

  Given "I visit my project's home page" do
    visit project_path(@project)
  end

128 129 130 131
  Given "I visit my project's settings page" do
    visit edit_project_path(@project)
  end

132
  Given "I visit my project's files page" do
133
    visit project_tree_path(@project, root_ref)
Nihad Abbasov's avatar
Nihad Abbasov committed
134 135
  end

136
  Given "I visit my project's commits page" do
137
    visit project_commits_path(@project, root_ref, {limit: 5})
138 139
  end

140
  Given "I visit my project's commits page for a specific path" do
141
    visit project_commits_path(@project, root_ref + "/app/models/project.rb", {limit: 5})
142 143
  end

randx's avatar
randx committed
144 145 146 147
  Given 'I visit my project\'s commits stats page' do
    visit stats_project_repository_path(@project)
  end

148
  Given "I visit my project's network page" do
149 150
    # Stub Graph max_size to speed up test (10 commits vs. 650)
    Network::Graph.stub(max_count: 10)
151

Sato Hiroyuki's avatar
Sato Hiroyuki committed
152
    visit project_graph_path(@project, root_ref)
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
  end

  Given "I visit my project's issues page" do
    visit project_issues_path(@project)
  end

  Given "I visit my project's merge requests page" do
    visit project_merge_requests_path(@project)
  end

  Given "I visit my project's wall page" do
    visit wall_project_path(@project)
  end

  Given "I visit my project's wiki page" do
168
    visit project_wiki_path(@project, :home)
169 170
  end

171 172 173 174
  When 'I visit project hooks page' do
    visit project_hooks_path(@project)
  end

175 176 177 178
  # ----------------------------------------
  # "Shop" Project
  # ----------------------------------------

Nihad Abbasov's avatar
Nihad Abbasov committed
179 180 181 182
  And 'I visit project "Shop" page' do
    visit project_path(project)
  end

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
183 184 185 186
  When 'I visit edit project "Shop" page' do
    visit edit_project_path(project)
  end

Nihad Abbasov's avatar
Nihad Abbasov committed
187 188 189 190 191
  Given 'I visit project branches page' do
    visit branches_project_repository_path(@project)
  end

  Given 'I visit compare refs page' do
Robert Speicher's avatar
Robert Speicher committed
192
    visit project_compare_index_path(@project)
Nihad Abbasov's avatar
Nihad Abbasov committed
193 194 195
  end

  Given 'I visit project commits page' do
196
    visit project_commits_path(@project, root_ref, {limit: 5})
197 198 199 200
  end

  Given 'I visit project commits page for stable branch' do
    visit project_commits_path(@project, 'stable', {limit: 5})
Nihad Abbasov's avatar
Nihad Abbasov committed
201 202 203
  end

  Given 'I visit project source page' do
204
    visit project_tree_path(@project, root_ref)
Nihad Abbasov's avatar
Nihad Abbasov committed
205 206 207
  end

  Given 'I visit blob file from repo' do
208
    visit project_tree_path(@project, File.join(ValidCommit::ID, ValidCommit::BLOB_FILE_PATH))
Nihad Abbasov's avatar
Nihad Abbasov committed
209 210 211
  end

  Given 'I visit project source page for "8470d70"' do
212
    visit project_tree_path(@project, "8470d70")
Nihad Abbasov's avatar
Nihad Abbasov committed
213 214 215 216 217 218 219 220 221 222 223
  end

  Given 'I visit project tags page' do
    visit tags_project_repository_path(@project)
  end

  Given 'I visit project commit page' do
    visit project_commit_path(@project, ValidCommit::ID)
  end

  And 'I visit project "Shop" issues page' do
224
    visit project_issues_path(project)
Nihad Abbasov's avatar
Nihad Abbasov committed
225 226 227 228 229 230 231 232
  end

  Given 'I visit issue page "Release 0.4"' do
    issue = Issue.find_by_title("Release 0.4")
    visit project_issue_path(issue.project, issue)
  end

  Given 'I visit project "Shop" labels page' do
233
    visit project_labels_path(project)
Nihad Abbasov's avatar
Nihad Abbasov committed
234 235 236 237 238 239 240
  end

  Given 'I visit merge request page "Bug NS-04"' do
    mr = MergeRequest.find_by_title("Bug NS-04")
    visit project_merge_request_path(mr.project, mr)
  end

241 242 243 244 245
  Given 'I visit merge request page "Bug NS-05"' do
    mr = MergeRequest.find_by_title("Bug NS-05")
    visit project_merge_request_path(mr.project, mr)
  end

Nihad Abbasov's avatar
Nihad Abbasov committed
246
  And 'I visit project "Shop" merge requests page' do
247
    visit project_merge_requests_path(project)
Nihad Abbasov's avatar
Nihad Abbasov committed
248 249 250
  end

  Given 'I visit project "Shop" milestones page' do
251
    visit project_milestones_path(project)
Nihad Abbasov's avatar
Nihad Abbasov committed
252 253 254
  end

  Then 'I visit project "Shop" team page' do
255
    visit project_team_index_path(project)
Nihad Abbasov's avatar
Nihad Abbasov committed
256 257 258 259 260 261 262
  end

  Then 'I visit project "Shop" wall page' do
    visit wall_project_path(project)
  end

  Given 'I visit project wiki page' do
263
    visit project_wiki_path(@project, :home)
Nihad Abbasov's avatar
Nihad Abbasov committed
264
  end
265 266 267 268

  def root_ref
    @project.repository.root_ref
  end
269 270 271 272

  def project
    project = Project.find_by_name!("Shop")
  end
Nihad Abbasov's avatar
Nihad Abbasov committed
273
end