Skip to content
Extraits de code Groupes Projets
Valider 823316d7 rédigé par Steffen van Bergerem's avatar Steffen van Bergerem
Parcourir les fichiers

Convert tag cukes to rspec tests

parent d44300c7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
@javascript
Feature: Interacting with tags
Background:
Given there is a user "Samuel Beckett" who's tagged "#rockstar"
And I am signed in
And I am on the homepage
Scenario: Searching for a tag
When I search for "#rockstar"
Then I should be on the tag page for "rockstar"
And I should see "Samuel Beckett"
@javascript
Feature: Issue #3382 The comments under postings are missing when using the #tags -view
Background:
Given a user named "Bob Jones" with email "bob@bob.bob"
And I sign in as "bob@bob.bob"
When I post a status with the text "This is a post with a #tag"
And I am on the homepage
Scenario:
When I search for "#tag"
Then I should be on the tag page for "tag"
And I should see "This is a post with a #tag"
Scenario:
When I comment "this is a comment on my post" on "This is a post with a #tag"
And I search for "#tag"
Then I should be on the tag page for "tag"
And I should see "this is a comment on my post"
......@@ -47,9 +47,22 @@ describe TagsController, :type => :controller do
end
end
context 'with a tagged user' do
before do
bob.profile.tag_string = "#cats #diaspora #rad"
bob.profile.build_tags
bob.profile.save!
end
it 'includes the tagged user' do
get :show, :name => 'cats'
expect(response.body).to include(bob.diaspora_handle)
end
end
context 'with a tagged post' do
before do
eve.post(:status_message, text: "#what #yes #hellyes #foo", public: true, to: 'all')
@post = eve.post(:status_message, text: "#what #yes #hellyes #foo tagged post", public: true, to: 'all')
end
context 'signed in' do
......@@ -66,6 +79,17 @@ describe TagsController, :type => :controller do
get :show, :name => 'hellyes'
expect(response.status).to eq(200)
end
it 'includes the tagged post' do
get :show, :name => 'foo'
expect(assigns[:stream].posts.first.text).to include("tagged post")
end
it 'includes comments of the tagged post' do
alice.comment!(@post, "comment on a tagged post")
get :show, :name => 'foo', :format => 'json'
expect(response.body).to include("comment on a tagged post")
end
end
context "not signed in" do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter