test-for-30731.diff

Go MAEDA, 2019-03-25 09:33

Download (916 Bytes)

View differences:

test/functional/repositories_controller_test.rb (作業コピー)
182 182
    end
183 183
  end
184 184

  
185
  def test_show_should_show_diff_button_depending_on_browse_repository_permission
186
    @request.session[:user_id] = 2
187
    role = Role.find(1)
188

  
189
    role.add_permission! :browse_repository
190
    get :show, :params => {
191
      :id => 1
192
    }
193
    assert_response :success
194
    assert_select 'input[value="View differences"]'
195

  
196
    role.remove_permission! :browse_repository
197
    get :show, :params => {
198
      :id => 1
199
    }
200
    assert_response :success
201
    assert_select 'input[value="View differences"]', :count => 0
202
  end
203

  
185 204
  def test_revisions
186 205
    get :revisions, :params => {
187 206
        :id => 1,