When case study is promoted to Featured it should:

1. appear in the slideshow on /case-studies page
(if its "Authored on date" is the date of promotion)
Slideshow shows 4 most recently published case studies among Featured ones.

2. appear in the case study block on the front page
That block shows image and title of the random case study from 10 most recently published case studies among Featured ones. And the list of this case studies is cached. So this is going to be fun.

Comments

kssundar’s picture

Assigned: Unassigned » tvn
Status: Active » Needs review
Issue tags: +sprint 16

The homepage does not have any Case study display on git6site

pradeeprkara’s picture

kssundar’s picture

The slideshow in "/case-studies" is also cached. Currently I can see as below:

Page: /case-studies/manage
1. OnFlooring
2. The New MSKCC.org
3. BRIXS Group - An SEO Perspective
4. Sandusky Radio: 11 Stations, 1 CMS

Page: /case-studies
1. OnFlooring
2. The New MSKCC.org
3. BRIXS Group - An SEO Perspective
4. The Hopkins Company Architects

This is causing the test to fail. Any thoughts here?

kssundar’s picture

I have created this feature with new step definitions here - http://drupalcode.org/project/doobie.git/commit/4a61dcd

There are two scenarios:
1. The first scenario checks if the slideshow has the recently updated featured case studies or not. This is currently failing because of cache as explained in comment #3

2. The second scenario checks if the case study present on the homepage is one of the recent 10 featured case studies or not. This is also failing as mentioned in comment #1

kssundar’s picture

Title: Write tests for case study promotion » Write tests for case study promotion (casestudies_promotion.feature)

Updating title

tvn’s picture

Status: Needs review » Needs work

Re: #3 on case-studies/manage case studies are sorted by "Last updated" date, on /case-studies and in the slideshow they are sorted by "Authored on" date. Those dates can be different because people keep editing their case studies.

So if we want to use comparison with the list on case-studies/manage for this test - we need to modify that view and add "Authored on" column (which we can do on D7 only).

Alternatively, there is a page http://drupal.org/case-studies/featured, which shows all featured case studies, sorted by "Authored on" date, just without a slideshow.

Probably even better way to test this is next: create new case study, promote it to Featured, go on /case-studies -> it should be first one in the slideshow.

For the front page scenario, again - comparison with /manage won't work for the same reasons as mentioned above.
Re: #1 and 2. On the git7 site case studies functionality isn't ported yet afaik. For git6 - I'm working to get case studies displayed there.

kssundar’s picture

Status: Needs work » Needs review

Considered case-studies/featured and updated the feature accordingly.

Committed here - http://drupalcode.org/project/doobie.git/commit/4222c97

tvn’s picture

Assigned: tvn » Unassigned

Case studies show up on the front page on git6 site now. This is done via "drush rebuild-stats". So far it's only till the next site rebuild, but probably can be automated later.

Scenario: Cases study block on front page
should be one of the "8" recently published

- since in fact it's one of the 10 recently published, this scenario will fail sometimes.

kssundar’s picture

Assigned: Unassigned » tvn

This page http://drupal.org/case-studies/featured gives only 8 items per page. Any other way to get 10 items?

tvn’s picture

Assigned: tvn » Unassigned

No :( Probably we'll need to update /manage view on D7 after all.

kssundar’s picture

Assigned: Unassigned » tvn

For 6.x, we can comment out the second scenario "Scenario: Cases study block on front page" as 10 case studies are not available on featured page for comparison. We can handle that in D7 later. Any other suggestions here?

eliza411’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Yes, you can comment out the second scenario and focus on this when the @casestudies feature gets reviewed for D7.

tvn’s picture

Assigned: tvn » Unassigned

Agree with eliza411.

kssundar’s picture

Issue tags: +sprint 17

Currently on git7, the page http://git7site.devdrupal.org/case-studies/featured shows only 8 items perpage. As per #10, we need 10 items on this page otherwise the test result will appear flaky.

  Scenario: Cases study block on front page                                                # features\drupalorg\casestudies_promotion.feature:13
    Given I am on the homepage                                                             # FeatureContext::thatIAmOnTheHomepage()
    Then the case study should be one of the "10" recently published featured case studies # FeatureContext::theCaseStudyShouldBeOneOfTheRecentlyPublishedFe
aturedCaseStudies()
      There are less than '10' case studies on the page - http://git7site.devdrupal.org/case-studies/featured
kssundar’s picture

Status: Patch (to be ported) » Needs review
eliza411’s picture

Status: Needs review » Postponed (maintainer needs more info)

This is as ready as it can be until the D7 Drupal.org site is ready for feedback. I'm marking as Postponed because I'm still unclear on the number of results and amount of data expected - is it important that the view has been changed from 10 to 8 results? Seems like it'll need to be addresses as part of the feature set review.

tvn’s picture

The view had 8 results by design. We'll deal with this when D7 version is ready - either by changing the view to show 10 items or by changing the code for case study block on the front page to choose from 8 latest case studies instead of 10.

tvn’s picture

Issue summary: View changes

.