Skip to content
Snippets Groups Projects
Select Git revision
  • v12.10.0.pre
  • v12.9.0
  • v12.9.0-rc42
  • v12.8.7
  • v12.8.6
  • v12.8.5
  • v12.8.4
  • v12.8.3
  • v12.6.8
  • v12.7.7
  • v12.8.2
  • v12.8.1
  • v12.9.0.pre
  • v12.8.0
  • v12.8.0-rc42
  • v12.5.10
  • v12.7.6
  • v12.6.7
  • v12.7.5
  • v12.5.9
20 results
An error occurred while fetching branches. Retry the search.

gitlabhq1

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Luke Duncalfe authored
    The intention of this test is to ensure that the service class
    MergeRequests::PushOptionsHandlerService does not run when the
    :mr_push_options feature flag is disabled.
    
    This test was passing, however was not testing what it was supposed to
    be!
    
    For one, setting Feature.disable(:feature) in the test does not disable
    the feature, as rspec config in spec_helper stubs Feature to make all
    features enabled:
    
    https://gitlab.com/gitlab-org/gitlab-ce/commit/3ee48e422defaedd69946c607bd8d3672e510375
    
    So the feature was still enabled in the test.
    
    But this test wasn't failing because unfortunately I had put:
    
    ```
    expect(MergeRequests::PushOptionsHandlerService).to receive(:new)
    ```
    
    instead of not_to!
    
    This meant that the `.new` method was being stubbed, so the service
    class did not create a MergeRequest, which satisfied the second
    expectation.
    
    ```
    expect(MergeRequests::PushOptionsHandlerService).to receive(:new)
    ```
    37492c5d
    History
    Name Last commit Last update