New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AO3-4719 Refactor work search tests #2615
Conversation
@@ -93,6 +93,18 @@ | |||
|
|||
### GIVEN | |||
|
|||
Given(/^I have the Battle set loaded$/) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative would have been to use a Background
section in the Cucumber scenario, which would then make it clearer what has been loaded before each test for users who only read the feature file (if we ever get any "business" "stakeholders" to do that!). But as the Cucumber documentation recommends not having Background
s longer than 4 lines, and nobody who isn't a coder looks at them, I think this is probably the right approach here.
get :index, tag_id: @fandom.name | ||
expect(assigns(:works).items).to include(@work) | ||
expect(assigns(:works).items).not_to include(@work2) | ||
end | ||
|
||
xit "should show restricted works to logged-in users" do | ||
it "should show restricted works to logged-in users" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the test that breaks the import specs (I enabled it locally to check and the story_parser
tests failed). I suspect it's due to the fake_login
method which amongst other things, stubs the current_user
call to return a user who isn't an archivist, and then doesn't reset normal calls afterwards. I think this test needs to clean up after itself.
@ariana-paris @sarken it is unclear if you want me to move this to Background ? |
No, the Background thing was just a suggestion. I only requested changes it because you needed to fix the test, which I guess you did by putting it back the way it was. Something for another day! |
Pull Request Checklist
AO3-1234 Fix thing
)Issue
https://otwarchive.atlassian.net/browse/AO3-4719
Purpose
This just refactors the works searching, there will be another pull along in a bit to actually add coverage.
Testing
No manual testing