Project

General

Profile

Patch #18789 » issues_ui_tests.diff

UI tests - Ondřej Ezr, 2015-01-09 11:18

View differences:

test/ui/issues_test.rb
49 49
    # check issue attributes
50 50
    assert_equal 'jsmith', issue.author.login
51 51
    assert_equal 1, issue.project.id
52
    assert_equal IssueStatus.find_by_name('New'), issue.status 
52
    assert_equal IssueStatus.find_by_name('New'), issue.status
53 53
    assert_equal Tracker.find_by_name('Bug'), issue.tracker
54 54
    assert_equal IssuePriority.find_by_name('Low'), issue.priority
55 55
    assert_equal 'Value for field 2', issue.custom_field_value(CustomField.find_by_name('Searchable field'))
......
60 60
      :field_format => 'string',
61 61
      :name => 'Field1',
62 62
      :is_for_all => true,
63
      :trackers => Tracker.find_all_by_id([1, 2])
63
      :trackers => Tracker.where(id: [1, 2]).to_a
64 64
    )
65 65
    field2 = IssueCustomField.create!(
66 66
      :field_format => 'string',
67 67
      :name => 'Field2',
68 68
      :is_for_all => true,
69
      :trackers => Tracker.find_all_by_id(2)
69
      :trackers => Tracker.where(id: 2).to_a
70 70
    )
71 71

  
72 72
    Role.non_member.add_permission! :add_issues
......
188 188
      :field_format => 'string',
189 189
      :name => 'Form update CF',
190 190
      :is_for_all => true,
191
      :trackers => Tracker.find_all_by_name('Feature request')
191
      :trackers => Tracker.where(name: 'Feature request').to_a
192 192
    )
193 193

  
194 194
    Role.non_member.add_permission! :edit_issues
......
237 237
      within('#context-menu') do
238 238
        click_link 'Watch'
239 239
      end
240
      assert page.has_css?('#context-menu .issue-1-watcher.icon-fav')
240 241
      assert page.has_css?('tr#issue-1')
241 242
    end
242 243
    assert Issue.find(1).watched_by?(User.find_by_login('jsmith'))
......
254 255
      within('#context-menu') do
255 256
        click_link 'Watch'
256 257
      end
258
      assert page.has_css?('#context-menu .issue-bulk-watcher.icon-fav')
257 259
      assert page.has_css?('tr#issue-1')
258 260
      assert page.has_css?('tr#issue-4')
259 261
    end
(1-1/2)