[#73458] Missing feature specs on drag & drop#22545
Conversation
|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
|
This PR should target |
EinLama
left a comment
There was a problem hiding this comment.
I think something is not yet quite right here 🤔
The spec spec/features/oauth/authorization_code_flow_spec.rb is failing - and it is failing locally on my machine, too. I suspected it was related to unmocking the RequestStore - but I cannot make it green it by removing it.
Further investigation is necessary here.
| before do | ||
| logout | ||
| login_with(current_user.login, user_password) | ||
| planning_page.visit! |
There was a problem hiding this comment.
Interestingly, these two lines along with the password definition in the user variable can be removed and this test will still pass. So the logout hack is not necessary ☝️
This only works with the RequestStore unmocking in place 🤔 However, that one might be causing a failing spec (see other comment). If so, the unmocking should be moved here instead of residing in the authentication helper.
There was a problem hiding this comment.
Also, if the logout is not necessary, why does the unmocking have an effect? There might be other effects at play here.
There was a problem hiding this comment.
Interestingly, these two lines along with the password definition in the user variable can be removed and this test will still pass. So the logout hack is not necessary ☝️
Yes, that is correct. However if the real login is removed, the spec will still pass even without the fix applied, producing a false positive.
Having the real login flow will make the test fail if the fix is not applied, which is the correct behaviour.
|
After some investigation, it seems like RequestStore is called with In def login_as(user)
# ...
allow(RequestStore).to receive(:[]).and_call_original
allow(RequestStore).to receive(:[]).with(:current_user).and_return(user)
end
# ...
def logout
# ...
# Reset RequestStore stubs - restore original behavior for all keys:
allow(RequestStore).to receive(:[]).and_call_original
endSigh if only there was a web app without state 😅 Not sure if this is a good idea. But it makes both specs green. Maybe you'll find a better solution that is less frail. |
abc98b6 to
1849038
Compare
1849038 to
0b0b4bd
Compare
EinLama
left a comment
There was a problem hiding this comment.
Thank you for fixing this 👏 What an intricate bug 😅
Ticket
https://community.openproject.org/work_packages/73458
What are you trying to accomplish?
What approach did you choose and why?
InboxControllerprepend_before_actionimpementation.Merge checklist