Skip to content

Commit

Permalink
Merge branch 'develop' into 3819_upgrade_to_rails_7
Browse files Browse the repository at this point in the history
  • Loading branch information
Florence-Njeri committed Feb 10, 2023
2 parents fe22725 + 1c0e4db commit 6bb2c3c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 13 deletions.
9 changes: 9 additions & 0 deletions app/views/projects/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<% show_it = (p.status == 'active' || p.status == 'Active' ? true : false) %>
<% follower_count = p.followers.count %>
<% commit_count = p.commit_count %>
<% last_update = p.last_github_update %>
<% content_tag :li, "", style: show_it ? '' : 'display: none;', class: show_it ? '' : 'inactive' %>
<div class="project_card">
<% if has_docs %>
Expand All @@ -67,6 +68,14 @@
</div>
<% end %>
<% end %>
<% unless last_update.nil? %>
<%= content_tag :div, "", style: show_it ? '' : 'display: none;', class: show_it ? 'col' : 'inactive' do -%>
<div data-toggle="tooltip" data-placement="top" title="last update on github">
<i class="fa fa-calendar"></i>
<%= format_date(last_update) %>
</div>
<% end %>
<% end %>
</div>
</div>
</li>
Expand Down
26 changes: 13 additions & 13 deletions features/projects/list_projects.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ Feature: Browse projects
Scenario: Display most recently updated at top "Our Projects" page
Given I am on the "home" page
When I follow "Projects" within the navbar
Then I should see "<title>" within "project-list":
| title |
| hello world |
| hello alpha |
| hello mars |
| hello mercury |
| hello jupiter |
| hello saturn |
| hello sun |
| hello terra |
And I should not see "<title>" within "project-list":
| title |
| hello venus |
Then I should see "<title>" and "<last_github_update>" within "project-list":
| title | last_github_update |
| hello world | 2000-01-13 |
| hello alpha | 2000-01-12 |
| hello mars | 1999-01-11 |
| hello mercury | 1999-01-09 |
| hello jupiter | 1999-01-10 |
| hello saturn | 1999-01-09 |
| hello sun | 1999-01-01 |
| hello terra | 1999-01-01 |
And I should not see "<title>" within "project-list":
| title |
| hello venus |

Scenario: Display pending projects
Given I am logged in as "Thomas"
Expand Down
15 changes: 15 additions & 0 deletions features/step_definitions/basic_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,21 @@ def assert_link_exists(path, text)
step %(I should not see "#{project_title}" within "#{project_list_area}")
end
end

Then('I should see {string} and {string} within {string}:') do |project_title, project_date, project_list_area, table|
table.rows.each do |row|
project_title = row.first
project_date = row.second
within("##{project_list_area}") do
expect(page).to have_content(project_title)
expect(page).to have_content(project_date)
#TODO: This line should work instead of above:
#expect(find('a', text: project_title).find(:xpath, "..").find('.fa-calendar')).to have_content(project_date)
end
end
end


Then /^I should receive a file(?: "([^"]*)")?/ do |file|
result = page.response_headers['Content-Type'].should == 'text/calendar'
result = page.response_headers['Content-Disposition'].should =~ /#{file}/ if result
Expand Down

0 comments on commit 6bb2c3c

Please sign in to comment.