Review Request 116810: Code cleaning (and modularization) of reports_spec.rb

Ahmed AbouElhamayed alwahsh.ahmed at gmail.com
Sat Mar 15 16:10:19 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/116810/#review52982
-----------------------------------------------------------


Thanks for your work. It's a good idea to use shared examples to avoid duplication. However, it looks like you've assumed that an editor behaves exactly like a super editor in the news section. This is not true. An editor can only edit his own news while a super editor can edit everybody's news.


spec/requests/news_reports_spec.rb
<https://git.reviewboard.kde.org/r/116810/#comment37289>

    This is problematic. A super editor shouldn't behave like an editor in the news section.


This line causes one of the tests to fail.
As for the issue of the 70 failing tests. This probably happens because the test database has not been created. Rails keeps a separate database for tests so you need to load the test database with the schema. You need to run "RAILS_ENV=test rake db:schema:load". The Readme file had an error in this line but I've corrected it now.
Note that no tests should be failing

- Ahmed AbouElhamayed


On March 15, 2014, 1:03 p.m., yash ladia wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/116810/
> -----------------------------------------------------------
> 
> (Updated March 15, 2014, 1:03 p.m.)
> 
> 
> Review request for KDE Websites and Ben Cooksley.
> 
> 
> Repository: reports-kde-org
> 
> 
> Description
> -------
> 
> I have split the reports_spec.rb (530 lines long) file into two files:
>   1. news_reports_spec.rb (152 lines)
>   2. project_reports_spec.rb (266 lines)
> I have used the rspec feature of "shared examples" to reduce code duplication.
> Also, I have removed some trailing whitespaces, changed few 'string' to "string" and removed some blank lines.
> 
> This patch has virtually no effect (except creating a few more users during testing) on the working of the code. It is just a code cleaning patch.
> 
> 
> Diffs
> -----
> 
>   spec/requests/news_reports_spec.rb PRE-CREATION 
>   spec/requests/project_reports_spec.rb PRE-CREATION 
>   spec/requests/reports_spec.rb 9cd9b4f 
> 
> Diff: https://git.reviewboard.kde.org/r/116810/diff/
> 
> 
> Testing
> -------
> 
> I have tested by running "bundle exec rspec" in both with and without this patch. The same results (87 examples, 70 failures, 16 pending) are obtained in both.
> 
> 
> Thanks,
> 
> yash ladia
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kde-www/attachments/20140315/acde9311/attachment.html>


More information about the kde-www mailing list